koel/resources/assets/js/components/layout/app-footer/FooterMiddlePane.spec.ts

25 lines
731 B
TypeScript
Raw Normal View History

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'
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 {
protected test () {
2022-07-10 14:19:11 +00:00
it('renders without a song', () => expect(this.render(FooterMiddlePane).html()).toMatchSnapshot())
2022-05-05 14:56:31 +00:00
it('renders with a song', () => {
expect(this.render(FooterMiddlePane, {
props: {
2022-07-10 14:19:11 +00:00
song: factory<Song>('song', {
title: 'Fahrstuhl to Heaven',
artist_name: 'Led Zeppelin',
artist_id: 3,
album_name: 'Led Zeppelin IV',
album_id: 4
})
}
}).html()).toMatchSnapshot()
})
}
}