mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
feat(test): add SearchSongResultsScreen component tests
This commit is contained in:
parent
719b3e7f18
commit
7c70d4bbdc
1 changed files with 21 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
import { expect, it } from 'vitest'
|
||||
import { searchStore } from '@/stores'
|
||||
import ComponentTestCase from '@/__tests__/ComponentTestCase'
|
||||
import SearchSongResultsScreen from './SearchSongResultsScreen.vue'
|
||||
|
||||
new class extends ComponentTestCase {
|
||||
protected test () {
|
||||
it('searches for prop query on created', () => {
|
||||
const resetResultMock = this.mock(searchStore, 'resetSongResultState')
|
||||
const searchMock = this.mock(searchStore, 'songSearch')
|
||||
this.render(SearchSongResultsScreen, {
|
||||
props: {
|
||||
q: 'search me'
|
||||
}
|
||||
})
|
||||
|
||||
expect(resetResultMock).toHaveBeenCalled()
|
||||
expect(searchMock).toHaveBeenCalledWith('search me')
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue