@playpilot/tpi 8.38.2 → 8.38.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
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
{/each}
|
|
169
169
|
</Rail>
|
|
170
170
|
{:then titles}
|
|
171
|
-
{@const titlesWithoutDuplicates = titles
|
|
171
|
+
{@const titlesWithoutDuplicates = titles?.filter((a, i, titles) => titles.findIndex(b => (b.sid === a.sid)) === i)}
|
|
172
172
|
|
|
173
173
|
{#if titles?.length >= minimumLength}
|
|
174
174
|
<Rail
|
|
@@ -36,7 +36,7 @@ describe('TitlesRail.svelte', () => {
|
|
|
36
36
|
})
|
|
37
37
|
|
|
38
38
|
it('Should render all titles', async () => {
|
|
39
|
-
const { getAllByTestId } = render(TitlesRail, { titles: [title, title] })
|
|
39
|
+
const { getAllByTestId } = render(TitlesRail, { titles: [{ ...title, sid: '1' }, { ...title, sid: '2' }] })
|
|
40
40
|
|
|
41
41
|
expect(getAllByTestId('title')).toHaveLength(2)
|
|
42
42
|
})
|
|
@@ -202,13 +202,13 @@ describe('TitlesRail.svelte', () => {
|
|
|
202
202
|
})
|
|
203
203
|
|
|
204
204
|
it('Should not render rails if fewer than given mimimumLength of titles were returned', () => {
|
|
205
|
-
const { container } = render(TitlesRail, { titles: [title, title], minimumLength: 3 })
|
|
205
|
+
const { container } = render(TitlesRail, { titles: [{ ...title, sid: '1' }, { ...title, sid: '2' }], minimumLength: 3 })
|
|
206
206
|
|
|
207
207
|
expect(container.querySelector('.titles .slider')).not.toBeTruthy()
|
|
208
208
|
})
|
|
209
209
|
|
|
210
210
|
it('Should render rails if equal or more than given mimimumLength of titles were returned', () => {
|
|
211
|
-
const { container } = render(TitlesRail, { titles: [title, title, title], minimumLength: 3 })
|
|
211
|
+
const { container } = render(TitlesRail, { titles: [{ ...title, sid: '1' }, { ...title, sid: '2' }, { ...title, sid: '3' }], minimumLength: 3 })
|
|
212
212
|
|
|
213
213
|
expect(container.querySelector('.titles .slider')).toBeTruthy()
|
|
214
214
|
})
|