2022-05-03 16:51:59 +00:00
|
|
|
import factory from '@/__tests__/factory'
|
2022-05-09 09:59:31 +00:00
|
|
|
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'
|
|
|
|
|
2022-05-09 09:59:31 +00:00
|
|
|
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
|
|
|
|
2022-05-09 09:59:31 +00:00
|
|
|
expect(queryAllByTestId('album-track-item')).toHaveLength(2)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|