[MM-52587] Clean up URL utils, use isInternalURL when possible (#2702)

This commit is contained in:
Devin Binnie
2023-05-03 08:48:41 -04:00
committed by GitHub
parent f3a4417464
commit e227c6bf1d
30 changed files with 481 additions and 634 deletions

View File

@@ -159,7 +159,7 @@ describe('main/app/app', () => {
await handleAppCertificateError(event, webContents, testURL, 'error-1', certificate, callback);
expect(callback).toHaveBeenCalledWith(true);
expect(certificateErrorCallbacks.has('http://server-1.com:error-1')).toBe(false);
expect(CertificateStore.add).toHaveBeenCalledWith('http://server-1.com', certificate);
expect(CertificateStore.add).toHaveBeenCalledWith(new URL('http://server-1.com'), certificate);
expect(CertificateStore.save).toHaveBeenCalled();
});
@@ -175,7 +175,7 @@ describe('main/app/app', () => {
await handleAppCertificateError(event, webContents, testURL, 'error-1', certificate, callback);
expect(callback).toHaveBeenCalledWith(false);
expect(certificateErrorCallbacks.has('http://server-1.com:error-1')).toBe(false);
expect(CertificateStore.add).toHaveBeenCalledWith('http://server-1.com', certificate, true);
expect(CertificateStore.add).toHaveBeenCalledWith(new URL('http://server-1.com'), certificate, true);
expect(CertificateStore.save).toHaveBeenCalled();
});
});