@playpilot/tpi 8.41.0 → 8.42.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.
@@ -1,5 +1,5 @@
1
1
  import { describe, it, expect, beforeEach, afterEach } from 'vitest'
2
- import { getFullUrlPath, getUrlParams, isUrlExcludedViaConfig, isParticipantsUrlExcludedViaConfig, paramsToString } from '$lib/url'
2
+ import { getFullUrlPath, getUrlParams, isUrlExcludedViaConfig, paramsToString } from '$lib/url'
3
3
 
4
4
  describe('url.ts', () => {
5
5
  describe('getFullUrlPath', () => {
@@ -113,27 +113,4 @@ describe('url.ts', () => {
113
113
  expect(isUrlExcludedViaConfig({ exclude_urls_pattern: '/some-page(/.*)?$' })).toBe(true)
114
114
  })
115
115
  })
116
-
117
- describe('isParticipantsUrlExcludedViaConfig', () => {
118
- it('Should return false if no key is given in config object', () => {
119
- expect(isParticipantsUrlExcludedViaConfig({})).toBe(false)
120
- })
121
-
122
- it('Should return false if no key is given but is empty', () => {
123
- expect(isParticipantsUrlExcludedViaConfig({ exclude_participants_urls_pattern: '' })).toBe(false)
124
- })
125
-
126
- it('Should return false if pattern is given but does not match url', () => {
127
- window.location.pathname = '/path'
128
- expect(isParticipantsUrlExcludedViaConfig({ exclude_participants_urls_pattern: '/not-path' })).toBe(false)
129
- })
130
-
131
- it('Should return true if pattern is given and does matches url', () => {
132
- window.location.pathname = '/path'
133
- expect(isParticipantsUrlExcludedViaConfig({ exclude_participants_urls_pattern: '/path' })).toBe(true)
134
-
135
- window.location.pathname = '/some-page/subpath'
136
- expect(isParticipantsUrlExcludedViaConfig({ exclude_participants_urls_pattern: '/some-page(/.*)?$' })).toBe(true)
137
- })
138
- })
139
116
  })
@@ -86,7 +86,7 @@ describe('Display.svelte', () => {
86
86
 
87
87
  it('Should render content subheader when given', () => {
88
88
  /** @ts-ignore */
89
- const { getByText } = render(Display, { campaign: { cta: { subheader: 'Some cta subheader' }, content: { } } })
89
+ const { getByText } = render(Display, { campaign: { cta: { subheader: 'Some cta subheader' }, content: {} } })
90
90
 
91
91
  expect(getByText('Some cta subheader')).toBeTruthy()
92
92
  })
@@ -153,4 +153,14 @@ describe('Display.svelte', () => {
153
153
 
154
154
  expect(container.querySelector('video')).toBeTruthy()
155
155
  })
156
+
157
+ it('Should render with expected content when slim variant is given', () => {
158
+ /** @ts-ignore */
159
+ const { container, queryByText } = render(Display, { slim: true, campaign: { campaign_type: 'video', cta: { header: 'Some header', subheader: 'Some cta subheader' }, content: { header_logo: 'dfg', video: 'abc' } } })
160
+
161
+ expect(container.querySelector('.slim')).toBeTruthy()
162
+ expect(container.querySelector('.logo')).toBeTruthy()
163
+ expect(queryByText('Some header')).toBeTruthy()
164
+ expect(queryByText('Some cta header')).not.toBeTruthy()
165
+ })
156
166
  })