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

33 lines
918 B
TypeScript
Raw Normal View History

import { expect, it } from 'vitest'
import factory from '@/__tests__/factory'
import { preferenceStore } from '@/stores'
2022-05-13 17:58:38 +00:00
import UnitTestCase from '@/__tests__/UnitTestCase'
import FooterExtraControls from './FooterExtraControls.vue'
2022-05-13 17:58:38 +00:00
new class extends UnitTestCase {
protected test () {
it('renders', () => {
preferenceStore.state.showExtraPanel = true
expect(this.render(FooterExtraControls, {
props: {
song: factory<Song>('song', {
2022-06-10 10:47:46 +00:00
playback_state: 'Playing',
2022-07-10 14:21:00 +00:00
title: 'Fahrstuhl to Heaven',
artist_name: 'Led Zeppelin',
artist_id: 3,
album_name: 'Led Zeppelin IV',
album_id: 4
})
2022-07-22 17:27:24 +00:00
},
global: {
stubs: {
RepeatModeSwitch: this.stub('RepeatModeSwitch'),
Volume: this.stub('Volume')
}
}
}).html()).toMatchSnapshot()
})
}
}