mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
26 lines
751 B
TypeScript
26 lines
751 B
TypeScript
import electron from 'electron';
|
|
|
|
import { clickLink } from '../electron-helpers';
|
|
|
|
/* eslint-disable no-restricted-properties */
|
|
describe('clickLink', () => {
|
|
it('should allow http links', () => {
|
|
const url = 'http://mockbin.org';
|
|
clickLink(url);
|
|
expect(electron.shell.openExternal).toHaveBeenCalledWith(url);
|
|
});
|
|
|
|
it('should allow https links', () => {
|
|
const url = 'https://mockbin.org';
|
|
clickLink(url);
|
|
expect(electron.shell.openExternal).toHaveBeenCalledWith(url);
|
|
});
|
|
|
|
it('should not allow smb links', () => {
|
|
const url = 'file:///C:/windows/system32/calc.exe';
|
|
clickLink(url);
|
|
expect(electron.shell.openExternal).not.toHaveBeenCalledWith(url);
|
|
});
|
|
});
|
|
/* eslint-enable no-restricted-properties */
|