Skip to content

Commit f9446c2

Browse files
committed
Fix authenticated renders
1 parent 02bcb84 commit f9446c2

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

site/src/testHelpers/handlers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const handlers = [
1717
}),
1818
// Workspace proxies
1919
rest.get("/api/v2/regions", async (req, res, ctx) => {
20-
console.log("Hit mocked regions!!!!")
2120
return res(
2221
ctx.status(200),
2322
ctx.json({

site/src/testHelpers/renderHelpers.tsx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
RouteObject,
2020
} from "react-router-dom"
2121
import { RequireAuth } from "../components/RequireAuth/RequireAuth"
22+
import { MockUser } from "./entities"
23+
import { AuthenticatedProviders } from "AppRouter"
2224

2325
export const history = createMemoryHistory()
2426

@@ -62,9 +64,14 @@ export function renderWithAuth(
6264
element: <RequireAuth />,
6365
children: [
6466
{
65-
element: <DashboardLayout />,
66-
children: [{ path, element }, ...extraRoutes],
67-
},
67+
element: <AuthenticatedProviders />,
68+
children: [
69+
{
70+
element: <DashboardLayout />,
71+
children: [{ path, element }, ...extraRoutes],
72+
},
73+
],
74+
}
6875
],
6976
},
7077
...nonAuthenticatedRoutes,
@@ -101,11 +108,16 @@ export function renderWithTemplateSettingsLayout(
101108
element: <RequireAuth />,
102109
children: [
103110
{
104-
element: <DashboardLayout />,
111+
element: <AuthenticatedProviders />,
105112
children: [
106113
{
107-
element: <TemplateSettingsLayout />,
108-
children: [{ path, element }, ...extraRoutes],
114+
element: <DashboardLayout />,
115+
children: [
116+
{
117+
element: <TemplateSettingsLayout />,
118+
children: [{ path, element }, ...extraRoutes],
119+
},
120+
],
109121
},
110122
],
111123
},
@@ -145,11 +157,16 @@ export function renderWithWorkspaceSettingsLayout(
145157
element: <RequireAuth />,
146158
children: [
147159
{
148-
element: <DashboardLayout />,
160+
element: <AuthenticatedProviders />,
149161
children: [
150162
{
151-
element: <WorkspaceSettingsLayout />,
152-
children: [{ path, element }, ...extraRoutes],
163+
element: <DashboardLayout />,
164+
children: [
165+
{
166+
element: <WorkspaceSettingsLayout />,
167+
children: [{ path, element }, ...extraRoutes],
168+
},
169+
],
153170
},
154171
],
155172
},

0 commit comments

Comments
 (0)