From 27ddd6e9343cc15a26f647e0340019c2654ffc3d Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza Date: Sun, 5 Jul 2026 07:25:24 -0300 Subject: [PATCH] test(dashboard): realign #6145 onboarding-href guard to the #6166 helper refactor The #6145 source-text guard asserted the inline `href={`/dashboard/providers/${connection.id}`}` literal. #6166 (already on release/v3.8.45) refactored that into the tested `buildProviderDetailsHref` helper, so the brittle literal-match guard went red on the release tip (and on every open PR's CI). Realign the guard to assert delegation to the id-based helper; the behavioral contract (route by id, not provider category) stays guarded by provider-onboarding-href.test.ts. --- .../onboarding-wizard-details-link-6145.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/unit/onboarding-wizard-details-link-6145.test.ts b/tests/unit/onboarding-wizard-details-link-6145.test.ts index 78ff6c67a73..52efbd241b9 100644 --- a/tests/unit/onboarding-wizard-details-link-6145.test.ts +++ b/tests/unit/onboarding-wizard-details-link-6145.test.ts @@ -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/` // 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)" ); });