2022-05-09 09:59:31 +00:00
|
|
|
import { expect, it } from 'vitest'
|
2022-05-05 14:56:31 +00:00
|
|
|
import factory from '@/__tests__/factory'
|
2022-05-13 17:58:38 +00:00
|
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
2022-05-09 09:59:31 +00:00
|
|
|
import FooterMiddlePane from './FooterMiddlePane.vue'
|
2022-05-05 14:56:31 +00:00
|
|
|
|
2022-05-13 17:58:38 +00:00
|
|
|
new class extends UnitTestCase {
|
2022-05-09 09:59:31 +00:00
|
|
|
protected test () {
|
|
|
|
it('renders without a song', () => {
|
|
|
|
expect(this.render(FooterMiddlePane).html()).toMatchSnapshot()
|
2022-05-05 14:56:31 +00:00
|
|
|
})
|
|
|
|
|
2022-05-09 09:59:31 +00:00
|
|
|
it('renders with a song', () => {
|
|
|
|
const album = factory<Album>('album', {
|
|
|
|
id: 42,
|
|
|
|
name: 'IV',
|
|
|
|
artist: factory<Artist>('artist', {
|
|
|
|
id: 104,
|
|
|
|
name: 'Led Zeppelin'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
const song = factory<Song>('song', {
|
|
|
|
album,
|
|
|
|
title: 'Fahrstuhl to Heaven',
|
|
|
|
artist: album.artist
|
|
|
|
})
|
2022-05-05 14:56:31 +00:00
|
|
|
|
2022-05-09 09:59:31 +00:00
|
|
|
expect(this.render(FooterMiddlePane, {
|
|
|
|
props: {
|
|
|
|
song
|
|
|
|
}
|
|
|
|
}).html()).toMatchSnapshot()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|