mirror of
https://github.com/koel/koel
synced 2024-12-21 18:13:13 +00:00
19 lines
553 B
TypeScript
19 lines
553 B
TypeScript
|
import { expect, it } from 'vitest'
|
||
|
import { fireEvent } from '@testing-library/vue'
|
||
|
import ComponentTestCase from '@/__tests__/ComponentTestCase'
|
||
|
import BtnCloseModal from './BtnCloseModal.vue'
|
||
|
|
||
|
new class extends ComponentTestCase {
|
||
|
protected test () {
|
||
|
it('renders', () => expect(this.render(BtnCloseModal).html()).toMatchSnapshot())
|
||
|
|
||
|
it('emits the event', async () => {
|
||
|
const { emitted, getByRole } = this.render(BtnCloseModal)
|
||
|
|
||
|
await fireEvent.click(getByRole('button'))
|
||
|
|
||
|
expect(emitted().click).toBeTruthy()
|
||
|
})
|
||
|
}
|
||
|
}
|