-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
325d061
commit 55b3a0e
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { subModuleObj as rtdProvider } from 'modules/dynamicAdBoostRtdProvider.js'; | ||
import { loadExternalScript } from '../../../src/adloader.js'; | ||
import { expect } from 'chai'; | ||
|
||
const configWithParams = { | ||
params: { | ||
keyId: 'dynamic', | ||
adUnits: ['gpt-123'], | ||
threshold: 1 | ||
} | ||
}; | ||
|
||
const configWithoutRequiredParams = { | ||
params: { | ||
keyId: '' | ||
} | ||
}; | ||
|
||
describe('dynamicAdBoost', function() { | ||
describe('init', function() { | ||
describe('initialize without expected params', function() { | ||
it('fails initalize when keyId is not present', function() { | ||
expect(rtdProvider.init(configWithoutRequiredParams)).to.be.false; | ||
}) | ||
}) | ||
|
||
describe('initialize with expected params', function() { | ||
it('successfully initialize with load script', function() { | ||
expect(rtdProvider.init(configWithParams)).to.be.true; | ||
setTimeout(function() { | ||
expect(loadExternalScript.called).to.be.true; | ||
}, 5000); | ||
}) | ||
}); | ||
}); | ||
}) |