Skip to content

Commit

Permalink
dynamicAdBoost tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adxpremium authored Aug 31, 2023
1 parent 325d061 commit 55b3a0e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/spec/modules/dynamicAdBoostRtdProvider_spec.js
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);
})
});
});
})

0 comments on commit 55b3a0e

Please sign in to comment.