@playpilot/tpi 5.6.0 → 5.7.0-beta.video-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,4 +37,24 @@ describe('TitlePopover.svelte', () => {
37
37
 
38
38
  expect(track).toHaveBeenCalledWith(TrackingEvent.TitlePopoverClose, title, { time_spent: 200 })
39
39
  })
40
+
41
+ it('Should render top scroll ad when given', () => {
42
+ // @ts-ignore
43
+ window.PlayPilotLinkInjections = { ads: [{ campaign_format: 'top_scroll', content: {}, cta: {} }] }
44
+
45
+ const event = new MouseEvent('mouseenter')
46
+ const { container } = render(TitlePopover, { event, title })
47
+
48
+ expect(container.querySelector('.top-scroll')).toBeTruthy()
49
+ })
50
+
51
+ it('Should not render top scroll ad when not given', () => {
52
+ // @ts-ignore
53
+ window.PlayPilotLinkInjections = { ads: null }
54
+
55
+ const event = new MouseEvent('mouseenter')
56
+ const { container } = render(TitlePopover, { event, title })
57
+
58
+ expect(container.querySelector('.top-scroll')).not.toBeTruthy()
59
+ })
40
60
  })