mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-02-02 11:48:25 +00:00
linkIsInternal: add test to ensure we don't regress on cases of SLDs
This commit is contained in:
parent
c4356e48f1
commit
1ad1844619
@ -5,6 +5,7 @@ const internalUrlWww = 'https://www.medium.com/';
|
||||
const sameBaseDomainUrl = 'https://app.medium.com/';
|
||||
const internalUrlCoUk = 'https://medium.co.uk/';
|
||||
const sameBaseDomainUrlCoUk = 'https://app.medium.co.uk/';
|
||||
const differentBaseDomainUrlCoUk = 'https://other.domain.co.uk/';
|
||||
const internalUrlSubPath = 'topic/technology';
|
||||
const externalUrl = 'https://www.wikipedia.org/wiki/Electron';
|
||||
const wildcardRegex = /.*/;
|
||||
@ -53,6 +54,12 @@ test('urls on the same "base domain" should be considered internal, long SLD', (
|
||||
).toEqual(true);
|
||||
});
|
||||
|
||||
test('urls on the a different "base domain" are considered NOT internal, long SLD', () => {
|
||||
expect(
|
||||
linkIsInternal(internalUrlCoUk, differentBaseDomainUrlCoUk, undefined),
|
||||
).toEqual(false);
|
||||
});
|
||||
|
||||
const testLoginPages = [
|
||||
'https://amazon.co.uk/signin',
|
||||
'https://amazon.com/signin',
|
||||
|
Loading…
x
Reference in New Issue
Block a user