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

25 lines
666 B
TypeScript
Raw Normal View History

2022-05-03 16:51:59 +00:00
import factory from '@/__tests__/factory'
import { expect, it } from 'vitest'
import ComponentTestCase from '@/__tests__/ComponentTestCase'
2022-05-03 16:51:59 +00:00
import AlbumTrackList from './AlbumTrackList.vue'
import TrackListItem from './AlbumTrackListItem.vue'
new class extends ComponentTestCase {
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)
})
}
}