Files
OmniRoute/tests/unit/onboarding-wizard-route-5427.test.ts
Diego Rodrigues de Sa e Souza 0adae00c7b Release v3.8.42 (#5459)
Release v3.8.42 — full CHANGELOG in CHANGELOG.md.

CI: 103 checks green incl. CodeQL (all languages), Semgrep, all 8 unit shards,
coverage, Node 24 compat, and integration tests. Full unit suite validated
locally: 19437 pass / 0 fail. The 3 red checks are advisory and do not gate
main (no required status checks): SonarCloud/SonarQube new-code coverage gate,
and PR Test Policy (test-masking detector flagging the legitimate dead-Phind
provider removal in #5530 — reviewed, correct).

Includes cycle-close reconciliation + repair of inherited base-red tests from
#5480/#5527/#5427/#5521 that the PR->release fast-path did not exercise.
2026-06-30 06:54:29 -03:00

37 lines
1.4 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
// Regression guard for #5427: the "Add Provider" / onboarding route
// (src/app/(dashboard)/dashboard/providers/new/page.tsx) was a redirect stub
// that bounced to /dashboard/providers, so every wizard button silently failed
// and the fully-built ProviderOnboardingWizard component stayed orphaned
// (never imported by any route). This asserts the route renders the wizard
// instead of redirecting, and that the wizard is wired into at least one route.
const here = dirname(fileURLToPath(import.meta.url));
const repoRoot = join(here, "..", "..");
const newRoute = join(
repoRoot,
"src/app/(dashboard)/dashboard/providers/new/page.tsx"
);
test("#5427: new-provider route does NOT redirect (no longer a silent stub)", () => {
const src = readFileSync(newRoute, "utf8");
assert.ok(
!/from\s+["']next\/navigation["']/.test(src) || !/\bredirect\s*\(/.test(src),
"new/page.tsx must not call redirect() from next/navigation — that reintroduces the #5427 silent failure"
);
});
test("#5427: new-provider route renders ProviderOnboardingWizard", () => {
const src = readFileSync(newRoute, "utf8");
assert.match(
src,
/ProviderOnboardingWizard/,
"new/page.tsx must render the ProviderOnboardingWizard component"
);
});