Files
OmniRoute/tests/unit/combo-guide-invocation-keys.test.ts
Dizzle 121023e418 docs: document combo invocation by exact model name (#7992) (#10779)
Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
2026-08-20 06:30:12 -03:00

38 lines
1.2 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { createRequire } from "node:module";
import { readFileSync } from "node:fs";
import path from "node:path";
const require = createRequire(import.meta.url);
const en = require("../../src/i18n/messages/en.json");
const invokeKeys = [
"usageGuideInvokeTitle",
"usageGuideInvokeDesc",
"usageGuideInvokeAutoNote",
"usageGuideInvokeOpenrouterNote",
];
test("combos: usage guide invocation keys exist in en.json with expected copy", () => {
for (const key of invokeKeys) {
assert.ok(
typeof en.combos[key] === "string" && en.combos[key].length > 0,
`combos.${key} missing`
);
}
assert.match(en.combos.usageGuideInvokeDesc, /exact name/);
assert.match(en.combos.usageGuideInvokeAutoNote, /does not use your combos/);
assert.match(en.combos.usageGuideInvokeOpenrouterNote, /paid OpenRouter product/);
});
test("combos: ComboUsageGuide renders the invocation keys via getI18nOrFallback", () => {
const page = readFileSync(
path.join(import.meta.dirname, "../../src/app/(dashboard)/dashboard/combos/page.tsx"),
"utf8"
);
for (const key of invokeKeys) {
assert.ok(page.includes(`"${key}"`), `page.tsx references combos.${key}`);
}
});