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 {
8282
8383``` js
8484// TestComponent.spec.js
85- import { render , fireEvent , cleanup } from ' @testing-library/vue'
85+ import { render , fireEvent } from ' @testing-library/vue'
8686import 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
You can’t perform that action at this time.
0 commit comments