Added additional test for domainLock template

This commit is contained in:
sanex3339
2020-07-26 20:38:14 +03:00
parent 553bea108b
commit 27a9e18a46
3 changed files with 32 additions and 2 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -461,6 +461,36 @@ describe('DomainLockTemplate', () => {
assert.throws(testFunc);
});
});
describe('Variant #4', () => {
const domainsString: string = ['example.com'].join(';');
const currentDomain: string = 'sub.example.com';
let testFunc: () => void;
before(() => {
const [
hiddenDomainsString,
diff
] = cryptUtils.hideString(domainsString, domainsString.length * 3);
testFunc = () => getFunctionFromTemplate(
{
domainLockFunctionName: 'domainLockFunction',
diff: diff,
domains: hiddenDomainsString,
globalVariableTemplate: GlobalVariableTemplate1(),
singleCallControllerFunctionName
},
singleCallControllerFunctionName,
getDocumentDomainTemplate(currentDomain)
);
});
it('should throw an error', () => {
assert.throws(testFunc);
});
});
});
describe('Variant #7: location.hostname', () => {