mirror of
https://github.com/koel/koel
synced 2024-12-21 01:53:11 +00:00
19 lines
651 B
TypeScript
19 lines
651 B
TypeScript
import { waitFor } from '@testing-library/vue'
|
|
import { expect, it } from 'vitest'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import { searchStore } from '@/stores'
|
|
import { eventBus } from '@/utils'
|
|
import SearchExceptsScreen from './SearchExcerptsScreen.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
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 waitFor(() => expect(mock).toHaveBeenCalledWith('search me'))
|
|
})
|
|
}
|
|
}
|