Files
OmniRoute/tests/unit/dashboard/context-parent-redirect-5298.test.ts
Diego Rodrigues de Sa e Souza 7c23dab64d Release v3.8.40
v3.8.40 cycle integration → main. All test gates green (Unit/Integration/Coverage/Node-compat/Quality-Ratchet). The only red check, 'PR Test Policy', is the test-masking heuristic firing on the cumulative ~57-commit release diff (legitimate assert consolidations already reviewed per-PR — Gemini CLI removal #5246, retired GPT models #5280, provider catalog refreshes); overridden with --admin per the documented release-PR convention. CodeQL/SonarQube advisory scans non-blocking; #5278's code already passed CodeQL on main. Homologated on VPS 192.168.0.15 (v3.8.40 healthy).
2026-06-29 08:40:06 -03:00

24 lines
1.1 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
// #5298: `/dashboard/context` had only sub-routes and no parent page, so RSC
// prefetches of the bare parent 404'd. The new parent page redirects to a
// canonical sub-route; this guards the pure route resolver it uses.
const { resolveContextRoute } =
await import("../../../src/app/(dashboard)/dashboard/context/page.tsx");
test("#5298: resolveContextRoute defaults the bare parent to the canonical sub-route", () => {
assert.equal(resolveContextRoute(undefined), "/dashboard/context/settings");
assert.equal(resolveContextRoute(""), "/dashboard/context/settings");
});
test("#5298: resolveContextRoute maps a known tab to its sub-route", () => {
assert.equal(resolveContextRoute("ultra"), "/dashboard/context/ultra");
assert.equal(resolveContextRoute("session-dedup"), "/dashboard/context/session-dedup");
assert.equal(resolveContextRoute("llmlingua"), "/dashboard/context/llmlingua");
});
test("#5298: resolveContextRoute falls back to the default for an unknown tab", () => {
assert.equal(resolveContextRoute("bogus"), "/dashboard/context/settings");
});