Skip to content

Commit de9a25b

Browse files
committed
add tests
1 parent 49129be commit de9a25b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/app/components/ATIAnalytics/atiUrl/index.client.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,40 @@ describe('atiUrl', () => {
257257
});
258258
});
259259

260+
it('should include skip-rate fields when provided on itemTracker', () => {
261+
const componentSpecificTrack = buildReverbEventModel({
262+
...input,
263+
itemTracker: {
264+
type: 'portrait-video',
265+
text: 'Example title',
266+
duration: 9000,
267+
totalDuration: 12000,
268+
completionRate: 0.75,
269+
skipRate: 0.25,
270+
navigationMethod: 'swipe',
271+
exitReason: 'navigation',
272+
versionId: 'p1234567',
273+
resourceId: 'urn:bbc:pips:pid:p1234567',
274+
},
275+
});
276+
277+
expect(componentSpecificTrack.eventDetails.item).toEqual({
278+
attribution: 'advertiserID',
279+
duration: 9000,
280+
exit_reason: 'navigation',
281+
link: 'http://localhost',
282+
name: 'top-stories',
283+
navigation_method: 'swipe',
284+
resource_id: 'urn:bbc:pips:pid:p1234567',
285+
skip_rate: 0.25,
286+
text: 'Example title',
287+
total_duration: 12000,
288+
type: 'portrait-video',
289+
completion_rate: 0.75,
290+
version_id: 'p1234567',
291+
});
292+
});
293+
260294
it('should return the correct Reverb group event model', () => {
261295
const blockSpecificTrack = buildReverbEventModel({
262296
...input,

0 commit comments

Comments
 (0)