koel/resources/assets/js/components/ui/ScreenControlsToggle.spec.ts

17 lines
494 B
TypeScript
Raw Normal View History

import { expect, it } from 'vitest'
import { screen } from '@testing-library/vue'
2022-05-13 17:58:38 +00:00
import UnitTestCase from '@/__tests__/UnitTestCase'
2022-06-10 10:47:46 +00:00
import ScreenControlsToggle from './ScreenControlsToggle.vue'
2022-05-13 17:58:38 +00:00
new class extends UnitTestCase {
protected test () {
it('renders and emits an event', async () => {
const { emitted } = this.render(ScreenControlsToggle)
await this.user.click(screen.getByRole('checkbox'))
expect(emitted()['update:modelValue']).toBeTruthy()
})
}
}