mirror of
https://github.com/koel/koel
synced 2024-12-21 10:03:10 +00:00
35 lines
863 B
TypeScript
35 lines
863 B
TypeScript
import { expect, it } from 'vitest'
|
|
import factory from '@/__tests__/factory'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import FooterMiddlePane from './FooterMiddlePane.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
protected test () {
|
|
it('renders without a song', () => {
|
|
expect(this.render(FooterMiddlePane).html()).toMatchSnapshot()
|
|
})
|
|
|
|
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
|
|
})
|
|
|
|
expect(this.render(FooterMiddlePane, {
|
|
props: {
|
|
song
|
|
}
|
|
}).html()).toMatchSnapshot()
|
|
})
|
|
}
|
|
}
|