mirror of
https://github.com/koel/koel
synced 2024-12-24 11:33:05 +00:00
36 lines
1 KiB
TypeScript
36 lines
1 KiB
TypeScript
import { expect, it } from 'vitest'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import ThumbnailStack from './ThumbnailStack.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
protected test () {
|
|
it('displays 4 thumbnails at most', () => {
|
|
const { getAllByTestId } = this.render(ThumbnailStack, {
|
|
props: {
|
|
thumbnails: [
|
|
'https://via.placeholder.com/150',
|
|
'https://via.placeholder.com/150?foo',
|
|
'https://via.placeholder.com/150?bar',
|
|
'https://via.placeholder.com/150?baz',
|
|
'https://via.placeholder.com/150?qux'
|
|
]
|
|
}
|
|
})
|
|
|
|
expect(getAllByTestId('thumbnail')).toHaveLength(4)
|
|
})
|
|
|
|
it('displays the first thumbnail if less than 4 are provided', () => {
|
|
const { getAllByTestId } = this.render(ThumbnailStack, {
|
|
props: {
|
|
thumbnails: [
|
|
'https://via.placeholder.com/150',
|
|
'https://via.placeholder.com/150?foo'
|
|
]
|
|
}
|
|
})
|
|
|
|
expect(getAllByTestId('thumbnail')).toHaveLength(1)
|
|
})
|
|
}
|
|
}
|