mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-17 04:11:23 +00:00
test(guidance-data): add unit tests for buildDashboardHint (#3330)
Agent: test-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
98599d77b2
commit
61551928dd
1 changed files with 21 additions and 0 deletions
21
packages/cli/src/__tests__/guidance-data.test.ts
Normal file
21
packages/cli/src/__tests__/guidance-data.test.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { describe, expect, it } from "bun:test";
|
||||
import { buildDashboardHint } from "../guidance-data";
|
||||
|
||||
describe("buildDashboardHint", () => {
|
||||
it("returns a hint with the URL when provided", () => {
|
||||
const result = buildDashboardHint("https://example.com/dashboard");
|
||||
expect(result).toContain("https://example.com/dashboard");
|
||||
expect(result).toContain("Check your dashboard");
|
||||
});
|
||||
|
||||
it("returns a generic hint when URL is undefined", () => {
|
||||
const result = buildDashboardHint(undefined);
|
||||
expect(result).toContain("Check your cloud provider dashboard");
|
||||
expect(result).not.toContain("undefined");
|
||||
});
|
||||
|
||||
it("returns a generic hint when URL is empty string", () => {
|
||||
const result = buildDashboardHint("");
|
||||
expect(result).toContain("Check your cloud provider dashboard");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue