@playpilot/tpi 8.28.0-beta.1 → 8.29.0-beta.1

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.
@@ -118,6 +118,7 @@ describe('Playlink.svelte', () => {
118
118
  })
119
119
 
120
120
  it('Should render as link when user has not consented to affiliate but require_affiliate_consent is false', () => {
121
+ // @ts-ignore
121
122
  window.PlayPilotLinkInjections.config.require_affiliate_consent = false
122
123
 
123
124
  vi.mocked(hasConsentedTo).mockImplementation(() => false)
@@ -129,6 +130,7 @@ describe('Playlink.svelte', () => {
129
130
  })
130
131
 
131
132
  it('Should render as link when user has not consented to affiliate and require_affiliate_consent is true', () => {
133
+ // @ts-ignore
132
134
  window.PlayPilotLinkInjections.config.require_affiliate_consent = true
133
135
 
134
136
  vi.mocked(hasConsentedTo).mockImplementation(() => false)
@@ -36,6 +36,19 @@ describe('ParticipantsRail.svelte', () => {
36
36
  })
37
37
  })
38
38
 
39
+ it('Should render image only for participants with image', async () => {
40
+ const participantsWithImage = [...participants]
41
+ participantsWithImage[0].image = 'some-image.jpg'
42
+
43
+ vi.mocked(fetchParticipantsForTitle).mockResolvedValueOnce(participantsWithImage)
44
+
45
+ const { getAllByRole } = render(ParticipantsRail, { title })
46
+
47
+ await waitFor(() => {
48
+ expect(getAllByRole('presentation')).toHaveLength(1)
49
+ })
50
+ })
51
+
39
52
  it('Should order participants by their number of occurrences on the page', async () => {
40
53
  document.body.innerHTML = `<main>${participants[1].name}. ${participants[2].name}, ${participants[2].name}</main>`
41
54
  vi.mocked(fetchParticipantsForTitle).mockResolvedValueOnce(participants)