mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
Route onboarding provider-details link by node id (#6145). Integrated into release/v3.8.44.
This commit is contained in:
@@ -260,9 +260,9 @@ function ResultSummary({
|
||||
)}
|
||||
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{connection?.provider && (
|
||||
{connection?.id && (
|
||||
<Link
|
||||
href={`/dashboard/providers/${connection.provider}`}
|
||||
href={`/dashboard/providers/${connection.id}`}
|
||||
className="inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-primary/90"
|
||||
>
|
||||
{providerText(t, "onboardingOpenProviderDetails", "Open provider details")}
|
||||
|
||||
37
tests/unit/onboarding-wizard-details-link-6145.test.ts
Normal file
37
tests/unit/onboarding-wizard-details-link-6145.test.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
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 #6145: the onboarding success-screen "Open provider
|
||||
// details" link must route by `connection.id` (the node id the
|
||||
// `/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.
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url));
|
||||
const repoRoot = join(here, "..", "..");
|
||||
const wizard = readFileSync(
|
||||
join(
|
||||
repoRoot,
|
||||
"src/app/(dashboard)/dashboard/providers/components/onboarding/ProviderOnboardingWizard.tsx"
|
||||
),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
test("#6145: provider-details link routes by connection.id (matches the [id] route)", () => {
|
||||
assert.match(
|
||||
wizard,
|
||||
/href=\{`\/dashboard\/providers\/\$\{connection\.id\}`\}/,
|
||||
"the details link must build the URL from connection.id"
|
||||
);
|
||||
});
|
||||
|
||||
test("#6145: provider-details link must NOT use connection.provider (404s for compat providers)", () => {
|
||||
assert.doesNotMatch(
|
||||
wizard,
|
||||
/href=\{`\/dashboard\/providers\/\$\{connection\.provider\}`\}/,
|
||||
"connection.provider is the slug/type, not the node id — it 404s"
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user