koel/resources/assets/js/components/ui/AlbumArtistThumbnail.spec.ts

62 lines
1.2 KiB
TypeScript
Raw Normal View History

2022-05-13 17:58:38 +00:00
import UnitTestCase from '@/__tests__/UnitTestCase'
import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import Thumbnail from './AlbumArtistThumbnail.vue'
let album: Album
let artist: Artist
2022-05-13 17:58:38 +00:00
new class extends UnitTestCase {
private renderForAlbum () {
album = factory<Album>('album', {
name: 'IV',
cover: 'https://localhost/album.jpg'
})
return this.render(Thumbnail, {
props: {
entity: album
}
})
}
private renderForArtist () {
artist = factory<Artist>('artist', {
name: 'Led Zeppelin',
image: 'https://localhost/blimp.jpg'
})
return this.render(Thumbnail, {
props: {
entity: artist
}
})
}
protected test () {
it('renders for album', () => {
expect(this.renderForAlbum().html()).toMatchSnapshot()
})
it('renders for artist', () => {
expect(this.renderForArtist().html()).toMatchSnapshot()
})
it('plays album', async () => {
2022-06-10 10:47:46 +00:00
throw 'Unimplemented'
})
it('queues album', async () => {
2022-06-10 10:47:46 +00:00
throw 'Unimplemented'
})
it('plays artist', async () => {
2022-06-10 10:47:46 +00:00
throw 'Unimplemented'
})
it('queues artist', async () => {
2022-06-10 10:47:46 +00:00
throw 'Unimplemented'
})
}
}