mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
Stabilize CI runtime for updated deps and unblock Dependabot auto-format flow (#185)
* chore: apply ci and dependabot remediation changes * chore: auto-fix linting and formatting issues --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -32,15 +32,11 @@ function renderAtPath(path: string, child: React.ReactNode) {
|
||||
<Routes>
|
||||
<Route
|
||||
path="/dashboard/login"
|
||||
element={
|
||||
<ProtectedRoute>{child}</ProtectedRoute>
|
||||
}
|
||||
element={<ProtectedRoute>{child}</ProtectedRoute>}
|
||||
/>
|
||||
<Route
|
||||
path="/dashboard/*"
|
||||
element={
|
||||
<ProtectedRoute>{child}</ProtectedRoute>
|
||||
}
|
||||
element={<ProtectedRoute>{child}</ProtectedRoute>}
|
||||
/>
|
||||
</Routes>
|
||||
</MemoryRouter>,
|
||||
@@ -50,18 +46,12 @@ function renderAtPath(path: string, child: React.ReactNode) {
|
||||
}
|
||||
|
||||
test("ProtectedRoute does not mount children for protected paths while auth is loading", async () => {
|
||||
await renderAtPath(
|
||||
"/dashboard",
|
||||
<div data-testid="protected-child">protected</div>,
|
||||
)
|
||||
await renderAtPath("/dashboard", <div data-testid="protected-child">protected</div>)
|
||||
expect(document.querySelector("[data-testid='protected-child']")).toBeNull()
|
||||
})
|
||||
|
||||
test("ProtectedRoute renders children on the login page even while auth is loading", async () => {
|
||||
await renderAtPath(
|
||||
"/dashboard/login",
|
||||
<div data-testid="login-child">login</div>,
|
||||
)
|
||||
await renderAtPath("/dashboard/login", <div data-testid="login-child">login</div>)
|
||||
expect(document.querySelector("[data-testid='login-child']")).not.toBeNull()
|
||||
})
|
||||
|
||||
@@ -100,9 +90,6 @@ test("ProtectedRoute redirects unauthenticated users without mounting protected
|
||||
test("ProtectedRoute renders children once an authenticated profile resolves", async () => {
|
||||
mockLoading = false
|
||||
mockProfile = { id: 1, role: 0 }
|
||||
await renderAtPath(
|
||||
"/dashboard",
|
||||
<div data-testid="protected-child">protected</div>,
|
||||
)
|
||||
await renderAtPath("/dashboard", <div data-testid="protected-child">protected</div>)
|
||||
expect(document.querySelector("[data-testid='protected-child']")).not.toBeNull()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user