test(guidance-data): add unit tests for buildDashboardHint (#3330)
Some checks are pending
CLI Release / Build and release CLI (push) Waiting to run
Lint / ShellCheck (push) Waiting to run
Lint / Biome Lint (push) Waiting to run
Lint / macOS Compatibility (push) Waiting to run

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:
A 2026-04-20 23:22:38 -07:00 committed by GitHub
parent 98599d77b2
commit 61551928dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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");
});
});