MCPcopy Index your code
hub / github.com/coder/coder / renderWithOrganizationSettingsLayout

Function renderWithOrganizationSettingsLayout

site/src/testHelpers/renderHelpers.tsx:192–227  ·  view source on GitHub ↗
(
	element: JSX.Element,
	{
		path = "/",
		route = "/",
		extraRoutes = [],
		nonAuthenticatedRoutes = [],
	}: RenderWithAuthOptions = {},
)

Source from the content-addressed store, hash-verified

190}
191
192export function renderWithOrganizationSettingsLayout(
193 element: JSX.Element,
194 {
195 path = "/",
196 route = "/",
197 extraRoutes = [],
198 nonAuthenticatedRoutes = [],
199 }: RenderWithAuthOptions = {},
200) {
201 const routes: RouteObject[] = [
202 {
203 element: <RequireAuth />,
204 children: [
205 {
206 element: <DashboardLayout />,
207 children: [
208 {
209 element: <OrganizationSettingsLayout />,
210 children: [{ element, path }, ...extraRoutes],
211 },
212 ],
213 },
214 ],
215 },
216 ...nonAuthenticatedRoutes,
217 ];
218
219 const renderResult = renderWithRouter(
220 createMemoryRouter(routes, { initialEntries: [route] }),
221 );
222
223 return {
224 user: MockUserOwner,
225 ...renderResult,
226 };
227}
228
229export const waitForLoaderToBeRemoved = async (): Promise<void> => {
230 return waitFor(

Callers 2

renderPageFunction · 0.90
renderPageFunction · 0.90

Calls 1

renderWithRouterFunction · 0.85

Tested by 2

renderPageFunction · 0.72
renderPageFunction · 0.72