@playpilot/tpi 6.9.2 → 6.9.3
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/package.json
CHANGED
|
@@ -54,6 +54,11 @@ export type ConfigResponse = {
|
|
|
54
54
|
*/
|
|
55
55
|
require_affiliate_consent?: boolean
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Scroll reveal posters that show on mobile are enabled by default. Use this option to disable them.
|
|
59
|
+
*/
|
|
60
|
+
disable_scroll_reveal_posters?: boolean
|
|
61
|
+
|
|
57
62
|
/**
|
|
58
63
|
* The following options are all relevant for in text disclaimers, which renders as a disclaimer text within the article,
|
|
59
64
|
* rather than only inside of title cards.
|
|
@@ -14,8 +14,11 @@ function createPosterLink(top = 0, url = 'poster.jpg') {
|
|
|
14
14
|
return link
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
describe('
|
|
17
|
+
describe('PostersScrollReveal', () => {
|
|
18
18
|
beforeEach(() => {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
window.PlayPilotLinkInjections = {}
|
|
21
|
+
|
|
19
22
|
document.body.innerHTML = ''
|
|
20
23
|
|
|
21
24
|
Object.defineProperty(window, 'innerHeight', {
|
|
@@ -44,6 +47,19 @@ describe('FloatingPoster', () => {
|
|
|
44
47
|
expect(poster?.getAttribute('src')).toBe('poster.jpg')
|
|
45
48
|
})
|
|
46
49
|
|
|
50
|
+
it('Should not create poster when config object value is given', async () => {
|
|
51
|
+
window.PlayPilotLinkInjections.config = { disable_scroll_reveal_posters: true }
|
|
52
|
+
|
|
53
|
+
createPosterLink(500)
|
|
54
|
+
|
|
55
|
+
render(PostersScrollReveal)
|
|
56
|
+
|
|
57
|
+
window.dispatchEvent(new Event('scroll'))
|
|
58
|
+
|
|
59
|
+
const poster = document.querySelector('[data-playpilot-poster]')
|
|
60
|
+
expect(poster).not.toBeTruthy()
|
|
61
|
+
})
|
|
62
|
+
|
|
47
63
|
it('Should not create posters on desktop when link is in viewport', async () => {
|
|
48
64
|
createPosterLink(500)
|
|
49
65
|
|