Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/frontend/packages/swarm-ui/test/badge-titles.test.mjs

27 lines
1.1 KiB
JavaScript

// The model and effort badge tooltips. Run by `npm test`, which Node runs with
// its built-in test runner and type stripping.
import assert from "node:assert/strict";
import { test } from "node:test";
import { effortTitle, modelTitle } from "../src/agent/state/badge-titles.ts";
test("a plain model badge says what the alias resolved to, or nothing", () => {
assert.equal(modelTitle("claude-x-1", false), "resolved to claude-x-1");
assert.equal(modelTitle(undefined, false), undefined);
assert.equal(modelTitle("", false), undefined);
});
test("a clickable model badge says it opens the settings", () => {
assert.equal(
modelTitle("claude-x-1", true),
"resolved to claude-x-1. Click for the inference settings",
);
assert.equal(modelTitle(undefined, true), "Click for the inference settings");
});
test("the effort badge names its source and, when clickable, the click", () => {
assert.equal(effortTitle("swarm", false), "set by: swarm");
assert.equal(
effortTitle("swarm", true),
"set by: swarm. Click for the inference settings",
);
});