File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ /// <reference path="../index.d.ts" />
2+ import 'react-testing-library/cleanup-after-each'
3+ import { testHook } from 'react-hooks-testing-library'
4+ import { ActionsTester } from '../index'
5+ import { Model } from '../../src'
6+
7+ describe ( 'actions' , ( ) => {
8+ test ( 'call actions in action' , async ( ) => {
9+ const { useStore } = Model ( { ActionsTester } )
10+ let state : any
11+ let actions : any
12+ const { unmount } = testHook ( ( ) => {
13+ ; [ state , actions ] = useStore ( 'ActionsTester' )
14+ } )
15+ await actions . getData ( )
16+ unmount ( )
17+ expect ( state . data ) . toEqual ( { counter : 1000 } )
18+ } )
19+ } )
Original file line number Diff line number Diff line change 3838 "react" : " ^16.8.4" ,
3939 "react-dom" : " ^16.8.4" ,
4040 "react-hooks-testing-library" : " ^0.4.0" ,
41- "react-testing-library" : " ^6 .0.0" ,
41+ "react-testing-library" : " ^7 .0.0" ,
4242 "remark-cli" : " ^6.0.1" ,
4343 "remark-lint" : " ^6.0.4" ,
4444 "remark-preset-lint-recommended" : " ^3.0.2" ,
You can’t perform that action at this time.
0 commit comments