koel/resources/assets/js/components/album/AlbumTrackList.spec.ts

25 lines
651 B
TypeScript
Raw Normal View History

2022-05-03 16:51:59 +00:00
import factory from '@/__tests__/factory'
import { expect, it } from 'vitest'
2022-05-13 17:58:38 +00:00
import UnitTestCase from '@/__tests__/UnitTestCase'
2022-05-03 16:51:59 +00:00
import AlbumTrackList from './AlbumTrackList.vue'
import TrackListItem from './AlbumTrackListItem.vue'
2022-05-13 17:58:38 +00:00
new class extends UnitTestCase {
protected test () {
it('lists the correct number of tracks', () => {
const { queryAllByTestId } = this.render(AlbumTrackList, {
props: {
album: factory<Album>('album')
},
global: {
stubs: {
TrackListItem
}
}
})
2022-05-03 16:51:59 +00:00
expect(queryAllByTestId('album-track-item')).toHaveLength(2)
})
}
}