Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 19, 2023
1 parent d22ae8d commit 09796fd
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/__tests__/sessionid.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,35 +286,4 @@ describe('Session ID manager', () => {
expect(console.warn).toBeCalledTimes(3)
})
})

describe('sampling', () => {
it('respects sampled session', () => {
given('storedSessionIdData', () => [given.now, 'oldSessionID', given.timestampOfSessionStart, true])
expect(given.subject).toEqual({
windowId: 'oldWindowId',
sessionId: 'oldSessionID',
sessionStartTimestamp: given.timestampOfSessionStart,
})
})

it('respects excluded sampled session', () => {
given('storedSessionIdData', () => [given.now, 'oldSessionID', given.timestampOfSessionStart, false])
expect(given.subject).toEqual({
windowId: 'oldWindowId',
sessionId: 'oldSessionID',
sessionStartTimestamp: given.timestampOfSessionStart,
})
})

it('uses provided function to check for sampling', () => {
given.sessionIdManager.checkSampling = () => true
given('storedSessionIdData', () => [null, null, null])

expect(given.subject).toEqual({
windowId: 'newUUID',
sessionId: 'newUUID',
sessionStartTimestamp: given.timestamp,
})
})
})
})

0 comments on commit 09796fd

Please sign in to comment.