@playpilot/tpi 8.26.1 → 8.27.0

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.
@@ -1,5 +1,5 @@
1
1
  import { hasConsentedTo } from '$lib/consent'
2
- import { isPixelAllowed } from '$lib/pixel'
2
+ import { isRetargetingAllowed } from '$lib/retargeting'
3
3
  import { getUserId } from '$lib/user'
4
4
  import { RETARGETING_USER_ID_KEY } from '@playpilot/retargeting-tracking'
5
5
  import { beforeEach, describe, expect, it, vi } from 'vitest'
@@ -12,7 +12,7 @@ vi.mock('$lib/user', () => ({
12
12
  getUserId: vi.fn(),
13
13
  }))
14
14
 
15
- describe('pixel.ts', () => {
15
+ describe('retargeting.ts', () => {
16
16
  beforeEach(() => {
17
17
  // @ts-ignore
18
18
  window.PlayPilotLinkInjections = {}
@@ -28,35 +28,35 @@ describe('pixel.ts', () => {
28
28
  vi.mocked(hasConsentedTo).mockImplementation(() => true)
29
29
  window.PlayPilotLinkInjections.config = null
30
30
 
31
- expect(isPixelAllowed()).toBe(false)
31
+ expect(isRetargetingAllowed()).toBe(false)
32
32
  })
33
33
 
34
34
  it('Should return false if config object is without allow_retargeting_pixels', () => {
35
35
  vi.mocked(hasConsentedTo).mockImplementation(() => true)
36
36
  window.PlayPilotLinkInjections.config = { something: true }
37
37
 
38
- expect(isPixelAllowed()).toBe(false)
38
+ expect(isRetargetingAllowed()).toBe(false)
39
39
  })
40
40
 
41
41
  it('Should return false if config object is allow_retargeting_pixels is false', () => {
42
42
  vi.mocked(hasConsentedTo).mockImplementation(() => true)
43
43
  window.PlayPilotLinkInjections.config = { allow_retargeting_pixels: false }
44
44
 
45
- expect(isPixelAllowed()).toBe(false)
45
+ expect(isRetargetingAllowed()).toBe(false)
46
46
  })
47
47
 
48
48
  it('Should return true if config object is allow_retargeting_pixels is true', () => {
49
49
  vi.mocked(hasConsentedTo).mockImplementation(() => true)
50
50
  window.PlayPilotLinkInjections.config = { allow_retargeting_pixels: true }
51
51
 
52
- expect(isPixelAllowed()).toBe(true)
52
+ expect(isRetargetingAllowed()).toBe(true)
53
53
  })
54
54
 
55
55
  it('Should return false if config object is allow_retargeting_pixels is true but hasConsentedTo is false', () => {
56
56
  vi.mocked(hasConsentedTo).mockImplementation(() => false)
57
57
  window.PlayPilotLinkInjections.config = { allow_retargeting_pixels: true }
58
58
 
59
- expect(isPixelAllowed()).toBe(false)
59
+ expect(isRetargetingAllowed()).toBe(false)
60
60
  })
61
61
 
62
62
  it('Should set user id on window', () => {
@@ -67,7 +67,7 @@ describe('pixel.ts', () => {
67
67
  // @ts-ignore
68
68
  expect(window[RETARGETING_USER_ID_KEY]).not.toBeTruthy()
69
69
 
70
- isPixelAllowed()
70
+ isRetargetingAllowed()
71
71
 
72
72
  // @ts-ignore
73
73
  expect(window[RETARGETING_USER_ID_KEY]).toBe('abc')
@@ -15,8 +15,8 @@ vi.mock('$lib/tracking', () => ({
15
15
  track: vi.fn(),
16
16
  }))
17
17
 
18
- vi.mock('$lib/pixel', () => ({
19
- isPixelAllowed: vi.fn(),
18
+ vi.mock('$lib/retargeting', () => ({
19
+ isRetargetingAllowed: vi.fn(),
20
20
  }))
21
21
 
22
22
  vi.mock('$lib/api/participants', () => ({
@@ -15,8 +15,8 @@ vi.mock('$lib/tracking', () => ({
15
15
  track: vi.fn(),
16
16
  }))
17
17
 
18
- vi.mock('$lib/pixel', () => ({
19
- isPixelAllowed: vi.fn(),
18
+ vi.mock('$lib/retargeting', () => ({
19
+ isRetargetingAllowed: vi.fn(),
20
20
  }))
21
21
 
22
22
  vi.mock('$lib/api/participants', () => ({
@@ -8,8 +8,8 @@ vi.mock('$lib/tracking', () => ({
8
8
  track: vi.fn(),
9
9
  }))
10
10
 
11
- vi.mock('$lib/pixel', () => ({
12
- isPixelAllowed: vi.fn(),
11
+ vi.mock('$lib/retargeting', () => ({
12
+ isRetargetingAllowed: vi.fn(),
13
13
  }))
14
14
 
15
15
  vi.mock('$lib/consent', () => ({
@@ -11,8 +11,8 @@ vi.mock('$lib/tracking', () => ({
11
11
  track: vi.fn(),
12
12
  }))
13
13
 
14
- vi.mock('$lib/pixel', () => ({
15
- isPixelAllowed: vi.fn(),
14
+ vi.mock('$lib/retargeting', () => ({
15
+ isRetargetingAllowed: vi.fn(),
16
16
  }))
17
17
 
18
18
  vi.mock('svelte', async (importActual) => ({
@@ -11,8 +11,8 @@ vi.mock('$lib/tracking', () => ({
11
11
  track: vi.fn(),
12
12
  }))
13
13
 
14
- vi.mock('$lib/pixel', () => ({
15
- isPixelAllowed: vi.fn(),
14
+ vi.mock('$lib/retargeting', () => ({
15
+ isRetargetingAllowed: vi.fn(),
16
16
  }))
17
17
 
18
18
  vi.mock('$lib/api/participants', () => ({
@@ -1,18 +0,0 @@
1
- name: Asana
2
-
3
- on:
4
- pull_request:
5
- types: [opened, synchronize, reopened, edited]
6
-
7
- jobs:
8
- create-asana-attachment-job:
9
- runs-on: ubuntu-latest
10
- name: Create pull request attachments on Asana tasks
11
- steps:
12
- - name: Create pull request attachments
13
- uses: Asana/create-app-attachment-github-action@latest
14
- id: postAttachment
15
- with:
16
- asana-secret: ${{ secrets.ASANA_SECRET }}
17
- - name: Log output status
18
- run: echo "Status is ${{ steps.postAttachment.outputs.status }}"