@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.
- package/.prettierrc +1 -1
- package/dist/editorial.mount.js +11 -11
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +9 -9
- package/eslint.config.js +0 -1
- package/package.json +1 -1
- package/src/lib/explore.ts +2 -1
- package/src/lib/types/config.d.ts +2 -0
- package/src/lib/types/participant.d.ts +8 -0
- package/src/lib/types/position.d.ts +2 -0
- package/src/lib/types/script.d.ts +4 -2
- package/src/routes/components/Debugger.svelte +1 -1
- package/src/routes/components/Explore/Routes/ExploreModal.svelte +70 -19
- package/src/routes/components/Icons/IconAttribution.svelte +3 -0
- package/src/routes/components/InjectionPopover.svelte +1 -1
- package/src/routes/components/Modals/Modal.svelte +2 -1
- package/src/routes/components/Modals/ParticipantModal.svelte +1 -1
- package/src/routes/components/{Participant.svelte → Participants/Participant.svelte} +27 -9
- package/src/routes/components/Participants/ParticipantImage.svelte +130 -0
- package/src/routes/components/Rails/ParticipantsRail.svelte +21 -21
- package/src/routes/explore/+page.svelte +1 -2
- package/src/tests/lib/explore.test.js +4 -2
- package/src/tests/lib/injection.test.js +1 -1
- package/src/tests/lib/retargeting.test.js +2 -0
- package/src/tests/routes/components/{Participant.test.js → Participants/Participant.test.js} +20 -1
- package/src/tests/routes/components/Playlinks/Playlink.test.js +2 -0
- package/src/tests/routes/components/Rails/ParticipantsRail.test.js +13 -0
|
@@ -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)
|