2023-12-27 11:49:28 +00:00
|
|
|
import { expect, it } from 'vitest'
|
|
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
|
|
import { commonStore } from '@/stores'
|
|
|
|
import SpotifyIntegration from './SpotifyIntegration.vue'
|
|
|
|
|
|
|
|
new class extends UnitTestCase {
|
|
|
|
protected test () {
|
|
|
|
it.each<[boolean, boolean]>([[false, false], [false, true], [true, false], [true, true]])
|
|
|
|
('renders proper content with Spotify integration status %s, current user admin status %s',
|
|
|
|
(useSpotify, isAdmin) => {
|
2024-01-04 11:35:36 +00:00
|
|
|
commonStore.state.uses_spotify = useSpotify
|
2023-12-27 11:49:28 +00:00
|
|
|
|
|
|
|
if (isAdmin) {
|
2024-01-15 22:26:50 +00:00
|
|
|
this.beAdmin()
|
2023-12-27 11:49:28 +00:00
|
|
|
} else {
|
2024-01-15 22:26:50 +00:00
|
|
|
this.be()
|
2023-12-27 11:49:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
expect(this.render(SpotifyIntegration).html()).toMatchSnapshot();
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|