diff options
author | Matthew Miller <matthew@millerti.me> | 2021-08-03 05:04:54 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2021-08-03 05:04:54 -0700 |
commit | 23cf2ca8aa539bdf49e1b20731669b205dfb3ec7 (patch) | |
tree | 3893dfc35f609f408afcb8eac2af25ace1d27868 | |
parent | ac02d9f291f9cc321b8621f62af31773a7f277c3 (diff) |
Update SettingsService test
-rw-r--r-- | packages/server/src/services/settingsService.test.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/server/src/services/settingsService.test.ts b/packages/server/src/services/settingsService.test.ts index 67ee99c..cc455f7 100644 --- a/packages/server/src/services/settingsService.test.ts +++ b/packages/server/src/services/settingsService.test.ts @@ -51,31 +51,31 @@ jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B describe('setRootCertificate/getRootCertificate', () => { test('should accept cert as Buffer', () => { - settingsService.setRootCertificate({ + settingsService.setRootCertificates({ attestationFormat: 'android-safetynet', - certificate: gsr2, + certificates: [gsr2], }); - const cert = settingsService.getRootCertificate({ attestationFormat: 'android-safetynet' }); + const certs = settingsService.getRootCertificates({ attestationFormat: 'android-safetynet' }); - expect(cert).toEqual(gsr2AsPEM); + expect(certs).toEqual([gsr2AsPEM]); }); test('should accept cert as PEM string', () => { - settingsService.setRootCertificate({ + settingsService.setRootCertificates({ attestationFormat: 'apple', - certificate: apple, + certificates: [apple], }); - const cert = settingsService.getRootCertificate({ attestationFormat: 'apple' }); + const certs = settingsService.getRootCertificates({ attestationFormat: 'apple' }); - expect(cert).toEqual(appleAsPEM); + expect(certs).toEqual([appleAsPEM]); }); - test('should return empty string when certificate is not set', () => { - const cert = settingsService.getRootCertificate({ attestationFormat: 'none' }); + test('should return empty array when certificate is not set', () => { + const certs = settingsService.getRootCertificates({ attestationFormat: 'none' }); - expect(typeof cert).toEqual('string'); - expect(cert.length).toEqual(0); + expect(Array.isArray(certs)).toEqual(true); + expect(certs.length).toEqual(0); }); }); |