fix(web,ui): fix broken tests and remove legacy dashboard widgets (#457)
All checks were successful
ci/woodpecker/push/orchestrator Pipeline was successful
ci/woodpecker/push/api Pipeline was successful
ci/woodpecker/push/web Pipeline was successful

- Update Button.test.tsx assertions for CSS token-based Button component
- Rewrite page.test.tsx to test Phase 3 dashboard widgets
- Remove 4 unused legacy widgets: DomainOverview, RecentTasks,
  UpcomingEvents, QuickCapture (hardcoded light theme, pre-Phase 3)
- Remove orphaned QuickCaptureWidget test file

Tasks: MS-P1-001, MS-P1-002

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 17:58:29 -06:00
parent 4d6070a673
commit 8fa0b3059c
8 changed files with 35 additions and 449 deletions

View File

@@ -16,19 +16,21 @@ describe("Button", () => {
it("should apply primary variant styles by default", () => {
render(<Button>Primary</Button>);
const button = screen.getByRole("button");
expect(button.className).toContain("bg-blue-600");
expect(button.style.background).toBe("var(--ms-blue-500)");
});
it("should apply secondary variant styles", () => {
render(<Button variant="secondary">Secondary</Button>);
const button = screen.getByRole("button");
expect(button.className).toContain("bg-gray-200");
expect(button.style.background).toBe("transparent");
expect(button.style.border).toBe("1px solid var(--border)");
});
it("should apply danger variant styles", () => {
render(<Button variant="danger">Delete</Button>);
const button = screen.getByRole("button");
expect(button.className).toContain("bg-red-600");
expect(button.style.background).toBe("rgba(229, 72, 77, 0.12)");
expect(button.style.color).toBe("var(--danger)");
});
});
@@ -81,6 +83,6 @@ describe("Button", () => {
render(<Button className="custom-class">Custom</Button>);
const button = screen.getByRole("button");
expect(button.className).toContain("custom-class");
expect(button.className).toContain("bg-blue-600");
expect(button.style.background).toBe("var(--ms-blue-500)");
});
});