mirror of
https://github.com/koel/koel
synced 2024-12-21 10:03:10 +00:00
21 lines
671 B
TypeScript
21 lines
671 B
TypeScript
import { expect, it } from 'vitest'
|
|
import { searchStore } from '@/stores'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import SearchSongResultsScreen from './SearchSongResultsScreen.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
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')
|
|
})
|
|
}
|
|
}
|