File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -387,6 +387,19 @@ test("createInstance allows setting default props", async () => {
387387 expect ( onResolve ) . toHaveBeenCalledWith ( "done" )
388388} )
389389
390+ test ( "custom instances also have helper components" , async ( ) => {
391+ const promiseFn = ( ) => resolveTo ( "done" )
392+ const CustomAsync = createInstance ( { promiseFn } )
393+ const { getByText } = render (
394+ < CustomAsync >
395+ < CustomAsync . Loading > loading</ CustomAsync . Loading >
396+ < CustomAsync . Resolved > resolved</ CustomAsync . Resolved >
397+ </ CustomAsync >
398+ )
399+ await waitForElement ( ( ) => getByText ( "loading" ) )
400+ await waitForElement ( ( ) => getByText ( "resolved" ) )
401+ } )
402+
390403test ( "an unrelated change in props does not update the Context" , async ( ) => {
391404 let one
392405 let two
You can’t perform that action at this time.
0 commit comments