-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Expose Integration Name to Kit Object #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -317,6 +317,90 @@ describe('Rokt Forwarder', () => { | |
| ); | ||
| }); | ||
|
|
||
| it('should set integrationName on kit instance after attaching', async () => { | ||
| window.Rokt = new MockRoktForwarder(); | ||
| window.mParticle.Rokt = window.Rokt; | ||
| window.mParticle.Rokt.attachKitCalled = false; | ||
|
|
||
| window.mParticle.Rokt.attachKit = async () => { | ||
| window.mParticle.Rokt.attachKitCalled = true; | ||
| return Promise.resolve(); | ||
| }; | ||
|
|
||
| await mParticle.forwarder.init( | ||
| { | ||
| accountId: '123456', | ||
| }, | ||
| reportService.cb, | ||
| true | ||
| ); | ||
|
|
||
| // Wait for initialization to complete | ||
| await waitForCondition(() => window.mParticle.Rokt.isInitialized); | ||
|
|
||
| window.mParticle.Rokt.kit.integrationName.should.equal( | ||
| `${sdkVersion}_${kitVersion}` | ||
| ); | ||
|
Comment on lines
+339
to
+344
|
||
| }); | ||
|
|
||
| it('should set integrationName on kit instance with custom name when provided', async () => { | ||
| const customName = 'myCustomName'; | ||
|
|
||
| window.Rokt = new MockRoktForwarder(); | ||
| window.mParticle.Rokt = window.Rokt; | ||
| window.mParticle.Rokt.attachKitCalled = false; | ||
|
|
||
| window.mParticle.Rokt.attachKit = async () => { | ||
| window.mParticle.Rokt.attachKitCalled = true; | ||
| return Promise.resolve(); | ||
| }; | ||
|
alexs-mparticle marked this conversation as resolved.
Outdated
|
||
|
|
||
| window.mParticle.Rokt.launcherOptions = { | ||
| integrationName: customName, | ||
| }; | ||
|
|
||
| await mParticle.forwarder.init( | ||
| { | ||
| accountId: '123456', | ||
| }, | ||
| reportService.cb, | ||
| true | ||
| ); | ||
|
|
||
| // Wait for initialization to complete | ||
| await waitForCondition(() => window.mParticle.Rokt.isInitialized); | ||
|
|
||
| window.mParticle.Rokt.kit.integrationName.should.equal( | ||
| `${sdkVersion}_${kitVersion}_${customName}` | ||
| ); | ||
|
Comment on lines
+372
to
+377
|
||
| }); | ||
|
|
||
| it('should have integrationName available on kit after initialization', async () => { | ||
| window.Rokt = new MockRoktForwarder(); | ||
| window.mParticle.Rokt = window.Rokt; | ||
| window.mParticle.Rokt.attachKitCalled = false; | ||
|
|
||
| window.mParticle.Rokt.attachKit = async () => { | ||
| window.mParticle.Rokt.attachKitCalled = true; | ||
| return Promise.resolve(); | ||
| }; | ||
|
alexs-mparticle marked this conversation as resolved.
Outdated
|
||
|
|
||
| await mParticle.forwarder.init( | ||
| { | ||
| accountId: '123456', | ||
| }, | ||
| reportService.cb, | ||
| true | ||
| ); | ||
|
|
||
| // Wait for initialization to complete | ||
| await waitForCondition(() => window.mParticle.Rokt.isInitialized); | ||
|
|
||
| window.mParticle.Rokt.attachKitCalled.should.equal(true); | ||
| window.mParticle.Rokt.kit.integrationName.should.be.a.String(); | ||
| window.mParticle.Rokt.kit.integrationName.should.not.be.empty(); | ||
| }); | ||
|
Comment on lines
+399
to
+405
|
||
|
|
||
| it('should not mutate the global launcherOptions object during initialization', async () => { | ||
| const originalIntegrationName = 'globalIntegrationName'; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.