2022-10-13 15:18:47 +00:00
|
|
|
import { expect, it } from 'vitest'
|
2022-12-02 16:17:37 +00:00
|
|
|
import { ref } from 'vue'
|
2022-10-13 15:18:47 +00:00
|
|
|
import factory from '@/__tests__/factory'
|
|
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
2024-05-19 05:49:42 +00:00
|
|
|
import { CurrentPlayableKey } from '@/symbols'
|
2022-12-02 16:17:37 +00:00
|
|
|
import FooterSongInfo from './FooterSongInfo.vue'
|
2022-10-13 15:18:47 +00:00
|
|
|
|
|
|
|
new class extends UnitTestCase {
|
|
|
|
protected test () {
|
|
|
|
it('renders with no current song', () => expect(this.render(FooterSongInfo).html()).toMatchSnapshot())
|
|
|
|
|
|
|
|
it('renders with current song', () => {
|
2024-06-01 18:02:27 +00:00
|
|
|
const song = factory('song', {
|
2022-10-13 15:18:47 +00:00
|
|
|
title: 'Fahrstuhl zum Mond',
|
|
|
|
album_cover: 'https://via.placeholder.com/150',
|
|
|
|
playback_state: 'Playing',
|
|
|
|
artist_id: 10,
|
2024-10-13 17:37:01 +00:00
|
|
|
artist_name: 'Led Zeppelin',
|
2022-10-13 15:18:47 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
expect(this.render(FooterSongInfo, {
|
|
|
|
global: {
|
|
|
|
provide: {
|
2024-10-13 17:37:01 +00:00
|
|
|
[<symbol>CurrentPlayableKey]: ref(song),
|
|
|
|
},
|
|
|
|
},
|
2022-10-13 15:18:47 +00:00
|
|
|
}).html()).toMatchSnapshot()
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|