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'
|
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 {
|
2022-05-09 09:59:31 +00:00
|
|
|
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)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|