File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -82,23 +82,21 @@ export default {
82
82
83
83
``` js
84
84
// TestComponent.spec.js
85
- import { render , fireEvent , cleanup } from ' @testing-library/vue'
85
+ import { render , fireEvent } from ' @testing-library/vue'
86
86
import TestComponent from ' ./TestComponent.vue'
87
87
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 () => {
92
89
// The render method returns a collection of utilities to query your component.
93
90
const { getByText } = render (TestComponent)
94
91
95
92
// getByText returns the first matching node for the provided text, and
96
93
// throws an error if no elements match or if more than one match is found.
97
94
getByText (' Times clicked: 0' )
98
95
96
+ // `button` is the actual DOM element.
99
97
const button = getByText (' increment' )
100
98
101
- // Dispatch a native click event to our button element .
99
+ // Dispatch a native click event.
102
100
await fireEvent .click (button)
103
101
await fireEvent .click (button)
104
102
You can’t perform that action at this time.
0 commit comments