feat(test): add ScreenEmptyState component tests

This commit is contained in:
Phan An 2022-05-12 10:46:41 +02:00
parent 3196d138c1
commit 69ce0f5f9d
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
3 changed files with 26 additions and 1 deletions

View file

@ -1,8 +1,8 @@
import isMobile from 'ismobilejs'
import { expect, it } from 'vitest'
import { fireEvent } from '@testing-library/vue'
import ComponentTestCase from '@/__tests__/ComponentTestCase'
import ScreenControlsToggler from './ScreenControlsToggler.vue'
import { fireEvent } from '@testing-library/vue'
new class extends ComponentTestCase {
protected test () {

View file

@ -0,0 +1,16 @@
import { expect, it } from 'vitest'
import ComponentTestCase from '@/__tests__/ComponentTestCase'
import ScreenEmptyState from './ScreenEmptyState.vue'
new class extends ComponentTestCase {
protected test () {
it('renders', () => {
expect(this.render(ScreenEmptyState, {
slots: {
icon: '<i class="my-icon"/>',
default: 'Nothing here'
}
}).html()).toMatchSnapshot()
})
}
}

View file

@ -0,0 +1,9 @@
// Vitest Snapshot v1
exports[`renders 1`] = `
"<div class=\\"screen-empty-state\\" data-testid=\\"screen-empty-state\\">
<div><span class=\\"jumbo-icon\\"><i class=\\"my-icon\\"></i></span>
<div class=\\"text\\">Nothing here</div>
</div>
</div>"
`;