2022-05-09 09:59:31 +00:00
|
|
|
import { expect, it } from 'vitest'
|
2022-05-04 22:41:47 +00:00
|
|
|
import factory from '@/__tests__/factory'
|
|
|
|
import { preferenceStore } from '@/stores'
|
|
|
|
import SoundBar from '@/components/ui/SoundBar.vue'
|
|
|
|
import Volume from '@/components/ui/Volume.vue'
|
|
|
|
import LikeButton from '@/components/song/SongLikeButton.vue'
|
|
|
|
import RepeatModeSwitch from '@/components/ui/RepeatModeSwitch.vue'
|
|
|
|
import Equalizer from '@/components/ui/Equalizer.vue'
|
2022-05-13 17:58:38 +00:00
|
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
2022-05-09 09:59:31 +00:00
|
|
|
import FooterExtraControls from './FooterExtraControls.vue'
|
2022-05-04 22:41:47 +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', () => {
|
|
|
|
preferenceStore.state.showExtraPanel = true
|
2022-05-04 22:41:47 +00:00
|
|
|
|
2022-05-09 09:59:31 +00:00
|
|
|
expect(this.render(FooterExtraControls, {
|
|
|
|
props: {
|
|
|
|
song: factory<Song>('song', {
|
2022-06-10 10:47:46 +00:00
|
|
|
playback_state: 'Playing',
|
2022-05-09 09:59:31 +00:00
|
|
|
// Set these values for Like button's rendered HTML to be consistent
|
2022-06-10 10:47:46 +00:00
|
|
|
title: 'Fahrstuhl to Heaven'
|
2022-05-09 09:59:31 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
global: {
|
|
|
|
stubs: {
|
|
|
|
SoundBar,
|
|
|
|
Volume,
|
|
|
|
LikeButton,
|
|
|
|
RepeatModeSwitch,
|
|
|
|
Equalizer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).html()).toMatchSnapshot()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|