File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ test('render calls useEffect immediately', () => {
1414 expect ( effectCb ) . toHaveBeenCalledTimes ( 1 )
1515} )
1616
17+ test ( 'findByTestId returns the element' , async ( ) => {
18+ const ref = React . createRef ( )
19+ const { findByTestId} = render ( < div ref = { ref } data-testid = "foo" /> )
20+ expect ( await findByTestId ( 'foo' ) ) . toBe ( ref . current )
21+ } )
22+
1723test ( 'fireEvent triggers useEffect calls' , ( ) => {
1824 const effectCb = jest . fn ( )
1925 function Counter ( ) {
Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ import {
99import act , { asyncAct } from './act-compat'
1010
1111configureDTL ( {
12- asyncWrapper : asyncAct ,
12+ asyncWrapper : async cb => {
13+ let result
14+ await asyncAct ( async ( ) => {
15+ result = await cb ( )
16+ } )
17+ return result
18+ } ,
1319} )
1420
1521const mountedContainers = new Set ( )
You can’t perform that action at this time.
0 commit comments