mirror of
https://github.com/koel/koel
synced 2025-02-17 22:08:28 +00:00
Add tests for lyrics sidebar
This commit is contained in:
parent
282fd2cd15
commit
9b637c0726
1 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
import Lyrics from '@/components/main-wrapper/extra/lyrics.vue'
|
||||
import song from '@/tests/blobs/song'
|
||||
|
||||
describe('components/main-wrapper/extra/lyrics', () => {
|
||||
it('displays lyrics if the song has lyrics', () => {
|
||||
const wrapper = shallow(Lyrics, {
|
||||
propsData: { song }
|
||||
})
|
||||
wrapper.html().should.contain(song.lyrics)
|
||||
})
|
||||
|
||||
it('displays a fallback message if the song has no lyrics', () => {
|
||||
const songWithNoLyrics = _.clone(song)
|
||||
songWithNoLyrics.lyrics = null
|
||||
const wrapper = shallow(Lyrics, {
|
||||
propsData: {
|
||||
song: songWithNoLyrics
|
||||
}
|
||||
})
|
||||
wrapper.html().should.contain('No lyrics found. Are you not listening to Bach?')
|
||||
})
|
||||
})
|
Loading…
Add table
Reference in a new issue