Skip to content

Commit 48a99af

Browse files
committed
Keep simple test simpler
1 parent df5c120 commit 48a99af

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,21 @@ export default {
8282

8383
```js
8484
// TestComponent.spec.js
85-
import { render, fireEvent, cleanup } from '@testing-library/vue'
85+
import { render, fireEvent } from '@testing-library/vue'
8686
import TestComponent from './TestComponent.vue'
8787

88-
// automatically unmount and cleanup DOM after the test is finished.
89-
afterEach(cleanup)
90-
91-
it('increments value on click', async () => {
88+
test('increments value on click', async () => {
9289
// The render method returns a collection of utilities to query your component.
9390
const { getByText } = render(TestComponent)
9491

9592
// getByText returns the first matching node for the provided text, and
9693
// throws an error if no elements match or if more than one match is found.
9794
getByText('Times clicked: 0')
9895

96+
// `button` is the actual DOM element.
9997
const button = getByText('increment')
10098

101-
// Dispatch a native click event to our button element.
99+
// Dispatch a native click event.
102100
await fireEvent.click(button)
103101
await fireEvent.click(button)
104102

0 commit comments

Comments
 (0)