2
0
Fork 0
mirror of https://github.com/koel/koel synced 2025-01-01 15:28:43 +00:00
koel/resources/assets/js/components/layout/main-wrapper/sidebar/HomeButton.spec.ts

18 lines
522 B
TypeScript
Raw Normal View History

2024-06-16 15:40:33 +00:00
import { screen } from '@testing-library/vue'
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import { eventBus } from '@/utils'
import Component from './HomeButton.vue'
new class extends UnitTestCase {
protected test () {
it('triggers the sidebar toggle event', async () => {
this.mock(eventBus, 'emit')
this.render(Component)
await this.user.click(screen.getByRole('link'))
expect(eventBus.emit).toHaveBeenCalledWith('TOGGLE_SIDEBAR')
})
}
}