Can somebody point me in the right direction here?
Experimenting with TanStack Router and Unit Tests for UI.
Works partially but does not render Outlet for the "/" Route.
I have a test that does render(<RouterProvider router={testRouter} />); and successfully completes which uses a separate instance of a router which uses the generated routeTree.gen from the app. The content for the __root.tsx Route appears in the output of screen.debug() but it does not contain the content from the root index route i.e. the content of the <Outlet> which does show up fine when running the app normally. When doing await screen.findByText('<known-content>'); in that test it times out. The index route that does not render does use a loader (see below) but i assume that should be done in time (<100ms) or do i need to do something special to await that? Or is something else off in my approach?
export const Route = createFileRoute('/')({
component: RouteComponent,
loader: () => getResourceList(),
});
function RouteComponent() {
const resourceTable = Route.useLoaderData();
return <Menu resources={resourceTable} />;
}
I assume i am missing some basic understanding here.
Is this enough info to give me a hint here?