mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
18 lines
527 B
TypeScript
18 lines
527 B
TypeScript
import { screen } from '@testing-library/vue'
|
|
import { expect, it } from 'vitest'
|
|
import UnitTestCase from '@/__tests__/UnitTestCase'
|
|
import { eventBus } from '@/utils'
|
|
import LogoutButton from './LogoutButton.vue'
|
|
|
|
new class extends UnitTestCase {
|
|
protected test () {
|
|
it('emits the logout event', async () => {
|
|
const emitMock = this.mock(eventBus, 'emit')
|
|
this.render(LogoutButton)
|
|
|
|
await this.user.click(screen.getByRole('button'))
|
|
|
|
expect(emitMock).toHaveBeenCalledWith('LOG_OUT')
|
|
})
|
|
}
|
|
}
|