Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/unit/onboarding-wizard-details-link-6145.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, "..", "..");
Expand All @@ -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)"
);
});

Expand Down
Loading