1
1
import VuexTest from './components/VuexTest'
2
- import { render , Simulate , wait } from '../../src'
2
+ import { render , fireEvent , wait } from '../../src'
3
3
4
4
const store = {
5
5
state : {
@@ -16,15 +16,15 @@ const store = {
16
16
17
17
test ( 'can render with vuex with defaults' , async ( ) => {
18
18
const { getByTestId, getByText } = render ( VuexTest , { store } )
19
- Simulate . click ( getByText ( '+' ) )
19
+ fireEvent . click ( getByText ( '+' ) )
20
20
await wait ( )
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
- Simulate . click ( getByText ( '-' ) )
27
+ fireEvent . click ( getByText ( '-' ) )
28
28
await wait ( )
29
29
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '2' )
30
30
} )
@@ -35,10 +35,10 @@ 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
- Simulate . click ( getByText ( '+' ) )
38
+ fireEvent . click ( getByText ( '+' ) )
39
39
await wait ( )
40
40
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '1000' )
41
- Simulate . click ( getByText ( '-' ) )
41
+ fireEvent . click ( getByText ( '-' ) )
42
42
await wait ( )
43
43
expect ( getByTestId ( 'count-value' ) . textContent ) . toBe ( '1000' )
44
44
0 commit comments