| 116 | } |
| 117 | |
| 118 | export function renderWithTemplateSettingsLayout( |
| 119 | element: JSX.Element, |
| 120 | { |
| 121 | path = "/", |
| 122 | route = "/", |
| 123 | extraRoutes = [], |
| 124 | nonAuthenticatedRoutes = [], |
| 125 | }: RenderWithAuthOptions = {}, |
| 126 | ) { |
| 127 | const routes: RouteObject[] = [ |
| 128 | { |
| 129 | element: <RequireAuth />, |
| 130 | children: [ |
| 131 | { |
| 132 | element: <DashboardLayout />, |
| 133 | children: [ |
| 134 | { |
| 135 | element: <TemplateSettingsLayout />, |
| 136 | children: [{ path, element }, ...extraRoutes], |
| 137 | }, |
| 138 | ], |
| 139 | }, |
| 140 | ], |
| 141 | }, |
| 142 | ...nonAuthenticatedRoutes, |
| 143 | ]; |
| 144 | |
| 145 | const renderResult = renderWithRouter( |
| 146 | createMemoryRouter(routes, { initialEntries: [route] }), |
| 147 | ); |
| 148 | |
| 149 | return { |
| 150 | user: MockUserOwner, |
| 151 | ...renderResult, |
| 152 | }; |
| 153 | } |
| 154 | |
| 155 | export function renderWithWorkspaceSettingsLayout( |
| 156 | element: JSX.Element, |