Skip to content

Commit 63354bf

Browse files
committed
test: ct-only integration tests
1 parent e696a78 commit 63354bf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/specs/LeanplumIntegration.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,28 @@ describe('Integration Tests', () => {
151151
expect(clevertap.event.push)
152152
.toHaveBeenCalledWith('duplicated-event', {})
153153
})
154+
155+
it('suppresses all traffic in ct-only mode', () => {
156+
mockNextNetworkRequest(migrationResponses.CLEVERTAP)
157+
158+
lp.start('jon')
159+
160+
expect(networkMock.ajax).toHaveBeenCalledTimes(1)
161+
})
162+
163+
it('suppresses traffic after loading ct-only mode', () => {
164+
localStorage.setItem('__leanplum_migration_state', JSON.stringify(migrationResponses.CLEVERTAP.response[0]))
165+
lp = new LeanplumInternal(windowMock)
166+
lp.setAppIdForDevelopmentMode('app_123', 'dev_123')
167+
168+
lp.start('jon')
169+
170+
lp.track('event1')
171+
172+
lp.setUserAttributes({ name: 'Barney' })
173+
174+
expect(networkMock.ajax).not.toHaveBeenCalled()
175+
})
154176
})
155177

156178
function sleep(ms = 100) {

0 commit comments

Comments
 (0)