Replies: 2 comments 1 reply
-
@garth Have you ever figured out? |
Beta Was this translation helpful? Give feedback.
1 reply
-
The child component is executed, but since you're not supplying any A quick fix is to wait for the successive re-renders after the loader is executed and the Router state updates: - expect(page.getByTestId('name').innerHTML).toEqual('John Doe')
+ expect(await page.findByTestId('name').innerHTML).toEqual('John Doe') Or you can supply the hydration data direction to the render(
<Stub hydrationData={{
loaderData: {
root: {
name: 'John Doe',
},
},
}} />,
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Running the above test it seems that the child component is not executed. Documentation for
createRoutesStub
seems to be a little thin, any suggestions how to test components that rely on loader data from 'root'?Beta Was this translation helpful? Give feedback.
All reactions