mirror of
https://github.com/koel/koel
synced 2024-12-30 06:23:05 +00:00
18 lines
582 B
TypeScript
18 lines
582 B
TypeScript
import isMobile from 'ismobilejs'
|
|
import { expect, it } from 'vitest'
|
|
import { fireEvent } from '@testing-library/vue'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import ScreenControlsToggler from './ScreenControlsToggler.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
protected test () {
|
|
it('renders and emits an event on mobile', async () => {
|
|
isMobile.phone = true
|
|
const { emitted, getByTestId } = this.render(ScreenControlsToggler)
|
|
|
|
await fireEvent.click(getByTestId('controls-toggler'))
|
|
|
|
expect(emitted().toggleControls).toBeTruthy()
|
|
})
|
|
}
|
|
}
|