forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DigiTrust Facade init GH Issue 3911 (prebid#3918)
* GH Issue 3911 Fix to init the DigiTrust facade object if the userId framework would not normally execute the call due to an ID being found. * Fixed superfluous trailing arg issue. * Addition of unit test for digiTrustIdSystem. Fix init error in facade callback. * Uncommenting init code. * Reverting package-lock.json file. * Removed extraneous function parameter. * Removing unused code. Fixing file casing issue causing unit test to fail. * Adding support for SameSite=none to cookie * Tweaking unit test. * Removing Promise from unit test as IE doesn't like it. * Cleanup of unused code lines * Minor comment changes. * Commenting out unit tests to see if this fixes Safari timeout issue. * Reenable test. Fixing where done was not being called. * Whitespace changes for lint * Capture and clear fallback timer to fix unit tests. * Removing unused function * Comment improvements. Retry CircleCI for unassociated failure. * Removed old call to attachIdSystem.
- Loading branch information
1 parent
58230ef
commit 5f74875
Showing
3 changed files
with
84 additions
and
7 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
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
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,50 @@ | ||
import { | ||
digiTrustIdSubmodule, | ||
surfaceTestHook | ||
} from 'modules/digiTrustIdSystem'; | ||
|
||
let assert = require('chai').assert; | ||
let expect = require('chai').expect; | ||
|
||
var testHook = null; | ||
|
||
describe('DigiTrust Id System', function () { | ||
it('Should create the test hook', function (done) { | ||
testHook = surfaceTestHook(); | ||
assert.isNotNull(testHook, 'The test hook failed to surface'); | ||
var conf = { | ||
init: { | ||
member: 'unit_test', | ||
site: 'foo' | ||
}, | ||
callback: function (result) { | ||
} | ||
}; | ||
testHook.initDigitrustFacade(conf); | ||
window.DigiTrust.getUser(conf); | ||
expect(window.DigiTrust).to.exist; | ||
expect(window.DigiTrust.isMock).to.be.true; | ||
done(); | ||
}); | ||
|
||
it('Should report as client', function (done) { | ||
delete window.DigiTrust; | ||
testHook = surfaceTestHook(); | ||
|
||
var conf = { | ||
init: { | ||
member: 'unit_test', | ||
site: 'foo' | ||
}, | ||
callback: function (result) { | ||
expect(window.DigiTrust).to.exist; | ||
expect(result).to.exist; | ||
expect(window.DigiTrust.isMock).to.be.true; | ||
} | ||
}; | ||
testHook.initDigitrustFacade(conf); | ||
expect(window.DigiTrust).to.exist; | ||
expect(window.DigiTrust.isClient).to.be.true; | ||
done(); | ||
}); | ||
}); |