feat(service-storage-harness): slice 2 — qbit widgets + LineSeriesChart extract

This commit is contained in:
Developer
2026-07-09 08:46:20 +00:00
parent e7bd0afdd1
commit 1fb12b8a0a
14 changed files with 831 additions and 81 deletions
@@ -0,0 +1,34 @@
import { describe, it, expect } from "vitest";
import { render } from "@testing-library/react";
import { LineSeriesChart } from "../LineSeriesChart";
import type { ChartSeries } from "../LineSeriesChart";
describe("LineSeriesChart", () => {
it("renders without crashing with series data", () => {
const series: ChartSeries[] = [
{
label: "cpu",
points: [
{ t: 1000, v: 0.5 },
{ t: 2000, v: 0.8 },
],
},
];
const { container } = render(<LineSeriesChart series={series} />);
// ResponsiveContainer renders a wrapper div even in jsdom
expect(container.firstChild).not.toBeNull();
});
it("renders without crashing with empty series", () => {
const { container } = render(<LineSeriesChart series={[]} />);
expect(container.firstChild).not.toBeNull();
});
it("renders with custom height", () => {
const series: ChartSeries[] = [{ label: "dl", points: [{ t: 1, v: 1 }] }];
const { container } = render(
<LineSeriesChart series={series} height={200} />,
);
expect(container.firstChild).not.toBeNull();
});
});