mirror of
https://github.com/koel/koel
synced 2024-12-30 06:23:05 +00:00
18 lines
538 B
TypeScript
18 lines
538 B
TypeScript
import { expect, it } from 'vitest'
|
|
import { fireEvent } from '@testing-library/vue'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import BtnCloseModal from './BtnCloseModal.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
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()
|
|
})
|
|
}
|
|
}
|