1
1
import VuexTest from './components/VuexTest'
2
- import { render , fireEvent , wait } from '../../src'
2
+ import { render , fireEvent } from '../../src'
3
3
4
4
const store = {
5
5
state : {
@@ -16,16 +16,16 @@ const store = {
16
16
17
17
test ( 'can render with vuex with defaults' , async ( ) => {
18
18
const { getByTestId, getByText } = render ( VuexTest , { store } )
19
- fireEvent . click ( getByText ( '+' ) )
20
- await wait ( )
19
+ await fireEvent . click ( getByText ( '+' ) )
20
+
21
21
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '1' )
22
22
} )
23
23
24
24
test ( 'can render with vuex with custom initial state' , async ( ) => {
25
25
store . state . count = 3
26
26
const { getByTestId, getByText } = render ( VuexTest , { store } )
27
- fireEvent . click ( getByText ( '-' ) )
28
- await wait ( )
27
+ await fireEvent . click ( getByText ( '-' ) )
28
+
29
29
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '2' )
30
30
} )
31
31
@@ -35,11 +35,11 @@ test('can render with vuex with custom store', async () => {
35
35
36
36
const store = { state : { count : 1000 } }
37
37
const { getByTestId, getByText } = render ( VuexTest , { store } )
38
- fireEvent . click ( getByText ( '+' ) )
39
- await wait ( )
38
+
39
+ await fireEvent . click ( getByText ( '+' ) )
40
40
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '1000' )
41
- fireEvent . click ( getByText ( '-' ) )
42
- await wait ( )
41
+
42
+ await fireEvent . click ( getByText ( '-' ) )
43
43
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '1000' )
44
44
45
45
expect ( console . error ) . toHaveBeenCalled ( )
0 commit comments