19 lines
514 B
TypeScript
19 lines
514 B
TypeScript
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,
|
|
);
|
|
});
|