mirror of
https://github.com/koel/koel
synced 2024-12-22 02:23:14 +00:00
19 lines
621 B
TypeScript
19 lines
621 B
TypeScript
|
import { expect, it } from 'vitest'
|
||
|
import ComponentTestCase from '@/__tests__/ComponentTestCase'
|
||
|
import { searchStore } from '@/stores'
|
||
|
import { eventBus } from '@/utils'
|
||
|
import SearchExceptsScreen from './SearchExcerptsScreen.vue'
|
||
|
|
||
|
new class extends ComponentTestCase {
|
||
|
protected test () {
|
||
|
it('executes searching when the search keyword is changed', async () => {
|
||
|
const mock = this.mock(searchStore, 'excerptSearch')
|
||
|
this.render(SearchExceptsScreen)
|
||
|
eventBus.emit('SEARCH_KEYWORDS_CHANGED', 'search me')
|
||
|
await this.tick()
|
||
|
|
||
|
expect(mock).toHaveBeenCalledWith('search me')
|
||
|
})
|
||
|
}
|
||
|
}
|