| 153 | } |
| 154 | |
| 155 | export function renderWithWorkspaceSettingsLayout( |
| 156 | element: JSX.Element, |
| 157 | { |
| 158 | path = "/", |
| 159 | route = "/", |
| 160 | extraRoutes = [], |
| 161 | nonAuthenticatedRoutes = [], |
| 162 | }: RenderWithAuthOptions = {}, |
| 163 | ) { |
| 164 | const routes: RouteObject[] = [ |
| 165 | { |
| 166 | element: <RequireAuth />, |
| 167 | children: [ |
| 168 | { |
| 169 | element: <DashboardLayout />, |
| 170 | children: [ |
| 171 | { |
| 172 | element: <WorkspaceSettingsLayout />, |
| 173 | children: [{ element, path }, ...extraRoutes], |
| 174 | }, |
| 175 | ], |
| 176 | }, |
| 177 | ], |
| 178 | }, |
| 179 | ...nonAuthenticatedRoutes, |
| 180 | ]; |
| 181 | |
| 182 | const renderResult = renderWithRouter( |
| 183 | createMemoryRouter(routes, { initialEntries: [route] }), |
| 184 | ); |
| 185 | |
| 186 | return { |
| 187 | user: MockUserOwner, |
| 188 | ...renderResult, |
| 189 | }; |
| 190 | } |
| 191 | |
| 192 | export function renderWithOrganizationSettingsLayout( |
| 193 | element: JSX.Element, |