mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 19:52:50 +03:00
* fix(radar): refresh entitlement-sensitive state * chore(changelog): assign Radar fix to PR 9776 * test(radar): localize canonical feed fixture * test(radar): refresh canonical feed hash --------- Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
29 lines
830 B
TypeScript
29 lines
830 B
TypeScript
import assert from "node:assert/strict";
|
|
import { test } from "node:test";
|
|
|
|
import {
|
|
firstProviderConnectionId,
|
|
providerConnectionsRequestUrl,
|
|
} from "../../src/lib/radar/setupConnections.ts";
|
|
|
|
test("providerConnectionsRequestUrl filters the existing providers API", () => {
|
|
assert.equal(
|
|
providerConnectionsRequestUrl("openrouter/custom"),
|
|
"/api/providers?provider=openrouter%2Fcustom"
|
|
);
|
|
});
|
|
|
|
test("firstProviderConnectionId selects a real connection id, never the provider slug", () => {
|
|
assert.equal(
|
|
firstProviderConnectionId(
|
|
[
|
|
{ id: "connection-disabled", provider: "groq", isActive: false },
|
|
{ id: "connection-active", provider: "groq", isActive: true },
|
|
],
|
|
"groq"
|
|
),
|
|
"connection-active"
|
|
);
|
|
assert.equal(firstProviderConnectionId([], "groq"), null);
|
|
});
|