2022-05-03 16:51:59 +00:00
|
|
|
import { render } from '@/__tests__/__helpers__'
|
|
|
|
import factory from '@/__tests__/factory'
|
|
|
|
import { cleanup } from '@testing-library/vue'
|
2022-05-03 17:39:46 +00:00
|
|
|
import { beforeEach, expect, it } from 'vitest'
|
2022-05-03 16:51:59 +00:00
|
|
|
import AlbumTrackList from './AlbumTrackList.vue'
|
|
|
|
import TrackListItem from './AlbumTrackListItem.vue'
|
|
|
|
|
|
|
|
beforeEach(() => cleanup())
|
|
|
|
|
2022-05-03 17:39:46 +00:00
|
|
|
it('lists the correct number of tracks', () => {
|
2022-05-03 16:51:59 +00:00
|
|
|
const { queryAllByTestId } = render(AlbumTrackList, {
|
|
|
|
props: {
|
|
|
|
album: factory<Album>('album')
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
stubs: {
|
|
|
|
TrackListItem
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
expect(queryAllByTestId('album-track-item')).toHaveLength(2)
|
|
|
|
})
|