fix(KB-096): restore usage button in dashboard header

- Add the optional usage action back to the dashboard Header component
- Preserve the existing board search UI while restoring the usage button wiring
- Add Header tests for usage button rendering and click behavior
- Add a patch changeset for the restored header usage action
This commit is contained in:
gsxdsm
2026-03-30 04:58:50 -07:00
parent 0322f50907
commit 650b8ccfc3
3 changed files with 32 additions and 1 deletions

View File

@@ -153,6 +153,25 @@ describe("Header", () => {
});
});
describe("usage button", () => {
it("does not render usage button when onOpenUsage is not provided", () => {
renderHeader();
expect(screen.queryByTitle("View usage")).toBeNull();
});
it("renders usage button with correct title when onOpenUsage is provided", () => {
renderHeader({ onOpenUsage: vi.fn() });
expect(screen.getByTitle("View usage")).toBeDefined();
});
it("calls onOpenUsage when usage button is clicked", () => {
const onOpenUsage = vi.fn();
renderHeader({ onOpenUsage });
fireEvent.click(screen.getByTitle("View usage"));
expect(onOpenUsage).toHaveBeenCalled();
});
});
describe("planning button", () => {
it("renders planning button with correct title", () => {
renderHeader({ onOpenPlanning: vi.fn() });