feat: complete MVP foundation auth and dashboard
This commit is contained in:
18
tests/route-guards.test.ts
Normal file
18
tests/route-guards.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { getDashboardRedirectPath } from "../lib/route-guards";
|
||||
|
||||
test("getDashboardRedirectPath sends guests back to the auth entry", () => {
|
||||
assert.equal(getDashboardRedirectPath(null), "/");
|
||||
});
|
||||
|
||||
test("getDashboardRedirectPath lets authenticated mock users stay on dashboard", () => {
|
||||
assert.equal(
|
||||
getDashboardRedirectPath({
|
||||
name: "Matthias Meister",
|
||||
email: "matthias@webdev-pipeline.local",
|
||||
}),
|
||||
null,
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user