test(dashboard): realign #6145 onboarding-href guard to the #6166 helper refactor (#6270)

Realign the #6145 onboarding-href guard to the #6166 helper refactor (buildProviderDetailsHref). Test-only; unblocks the fast-path unit job across the open PR queue. Base-reds only (dast-smoke #6228, docs version-drift, executor-kiro anys). Integrated into release/v3.8.45.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-05 07:34:49 -03:00
committed by GitHub
parent c347abb774
commit 58abebd106

View File

@@ -9,6 +9,13 @@ import { dirname, join } from "node:path";
// `/dashboard/providers/[id]` route expects), NOT `connection.provider` (the
// provider slug/type). The old code produced `/dashboard/providers/<provider-slug>`
// which 404s for openai-compatible / anthropic-compatible providers.
//
// #6166 refactored the inline `href={`/dashboard/providers/${connection.id}`}`
// literal into the tested `buildProviderDetailsHref(connection)` helper (its
// id-based routing + null-safety is guarded behaviorally in
// `provider-onboarding-href.test.ts`). This guard now tracks that refactor: the
// wizard must delegate to the helper and must NOT reintroduce a raw
// `connection.provider` URL.
const here = dirname(fileURLToPath(import.meta.url));
const repoRoot = join(here, "..", "..");
@@ -20,11 +27,11 @@ const wizard = readFileSync(
"utf8"
);
test("#6145: provider-details link routes by connection.id (matches the [id] route)", () => {
test("#6145: provider-details link routes through buildProviderDetailsHref (id-based helper)", () => {
assert.match(
wizard,
/href=\{`\/dashboard\/providers\/\$\{connection\.id\}`\}/,
"the details link must build the URL from connection.id"
/buildProviderDetailsHref\(connection\)/,
"the details link must be built by the tested buildProviderDetailsHref helper (routes by connection.id)"
);
});