aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/src/stores/__tests__/ServiceBase.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared/src/stores/__tests__/ServiceBase.test.ts')
-rw-r--r--packages/shared/src/stores/__tests__/ServiceBase.test.ts23
1 files changed, 1 insertions, 22 deletions
diff --git a/packages/shared/src/stores/__tests__/ServiceBase.test.ts b/packages/shared/src/stores/__tests__/ServiceBase.test.ts
index e7aa078..e2b0aa9 100644
--- a/packages/shared/src/stores/__tests__/ServiceBase.test.ts
+++ b/packages/shared/src/stores/__tests__/ServiceBase.test.ts
@@ -66,14 +66,10 @@ const testCertificate: SnapshotIn<typeof Certificate> = {
66 66
67function createTestService( 67function createTestService(
68 snapshot: Partial<SnapshotIn<typeof ServiceBase>>, 68 snapshot: Partial<SnapshotIn<typeof ServiceBase>>,
69 profileSnapshot?: Partial<SnapshotIn<typeof Profile>>,
70): ServiceBase { 69): ServiceBase {
71 const sharedStore = SharedStoreBase.create({ 70 const sharedStore = SharedStoreBase.create({
72 profilesById: { 71 profilesById: {
73 testProfile: { 72 testProfile,
74 ...testProfile,
75 ...profileSnapshot,
76 },
77 }, 73 },
78 servicesById: { 74 servicesById: {
79 testService: { 75 testService: {
@@ -187,20 +183,3 @@ test('shows a certificate error warning if there is a certificate error', () =>
187 expect(service.securityLabel).toBe(SecurityLabelKind.CertificateError); 183 expect(service.securityLabel).toBe(SecurityLabelKind.CertificateError);
188 expect(service.alwaysShowLocationBar).toBe(true); 184 expect(service.alwaysShowLocationBar).toBe(true);
189}); 185});
190
191test('does not trust an untrusted certificate', () => {
192 const service = createTestService({});
193
194 expect(service.isCertificateTemporarilyTrusted(testCertificate)).toBe(false);
195});
196
197test('trusts a trusted certificate', () => {
198 const service = createTestService(
199 {},
200 {
201 temporarilyTrustedCertificates: [testCertificate],
202 },
203 );
204
205 expect(service.isCertificateTemporarilyTrusted(testCertificate)).toBe(true);
206});