| 190 | } |
| 191 | |
| 192 | export 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 | |
| 229 | export const waitForLoaderToBeRemoved = async (): Promise<void> => { |
| 230 | return waitFor( |