Files
manage/frontend/src/components/__tests__/DiskSpaceCard.test.tsx
T
Developer 109e74db41 feat(frontend): slice 2 — migrate 11 shared components to shadcn/Tailwind
Web UI rework. Shared-components slice (drift prevention):
- Migrate SectionCard, SelectionRailCard, TabbedCard, MetricCard,
  DiskSpaceCard, HoverEditButton, DialogFooter, ConfirmDialog,
  LibraryOverview, NowPlaying, SessionActivityPanel off @mui
- HoverEditButton: MUI IconButton + EditOutlined -> Button + lucide Pencil
- Status mapping uses the success Badge variant (chart-2) for healthy
- Exported APIs preserved so consuming pages still compile (no page edits)
- 11 behavioral Vitest component tests added

Gate: build + lint + test green.
2026-06-17 12:33:47 +00:00

23 lines
727 B
TypeScript

import { describe, it, expect } from "vitest";
import { render, screen } from "@testing-library/react";
import { DiskSpaceCard } from "../DiskSpaceCard";
describe("DiskSpaceCard", () => {
it("preserves the used / free / total breakdown and percent headline", () => {
render(
<DiskSpaceCard
used={500000000000}
available={500000000000}
size={1000000000000}
usedPct="50"
/>,
);
expect(screen.getByText(/50 used/i)).toBeInTheDocument();
expect(screen.getByText("Used")).toBeInTheDocument();
expect(screen.getByText("Free")).toBeInTheDocument();
expect(screen.getByText("Total")).toBeInTheDocument();
// Disk space label
expect(screen.getByText(/disk space/i)).toBeInTheDocument();
});
});