refactor: 리펙토링
This commit is contained in:
@@ -28,6 +28,15 @@ describe("installed route registry", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("treats every non-public route as explicitly session-required", () => {
|
||||
expect(ROUTE_REGISTRY.REFERENCE_RESOURCE_LIST.access).toBe(
|
||||
"session-required",
|
||||
);
|
||||
expect(
|
||||
decideRouteAccess("REFERENCE_RESOURCE_LIST", "unauthenticated"),
|
||||
).toEqual({ allowed: false, action: "show-sign-in" });
|
||||
});
|
||||
|
||||
it("bounds automatic redirects by pair and maximum hops", () => {
|
||||
const guard = createRedirectLoopGuard(2);
|
||||
expect(guard.allow("/private", "/signin")).toBe(true);
|
||||
@@ -36,5 +45,8 @@ describe("installed route registry", () => {
|
||||
expect(guard.allow("/signin", "/continue")).toBe(true);
|
||||
expect(guard.allow("/continue", "/final")).toBe(false);
|
||||
expect(guard.hopCount).toBe(2);
|
||||
|
||||
guard.reset();
|
||||
expect(guard.allow("/unrelated", "/canonical-unrelated")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user