spec(prometheus-direct-charting): verify + close SC-125 + reconcile tracking
Add loading-state tests to the three Prometheus widget test files (closes SC-125 PARTIAL). Write apply-progress.md, tick all 39 tasks, add verify-report.md (26/27 PASS, 1 PARTIAL->PASS). All gates green: 293 pytest, ruff clean, npm build+lint 0 errors. No blocking findings.
This commit is contained in:
@@ -30,6 +30,17 @@ function mockData(data: unknown, error?: string) {
|
||||
}
|
||||
|
||||
describe("PrometheusChartWidget", () => {
|
||||
it("renders skeleton while loading", () => {
|
||||
vi.mocked(useWidgets.useWidgetData).mockReturnValue({
|
||||
data: undefined,
|
||||
isLoading: true,
|
||||
} as unknown as ReturnType<typeof useWidgets.useWidgetData>);
|
||||
render(<PrometheusChartWidget widget={widget} refreshIntervalMs={60000} />);
|
||||
expect(
|
||||
document.querySelector('[data-slot="skeleton"]'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders a chart with series data", () => {
|
||||
mockData({
|
||||
series: [
|
||||
|
||||
@@ -30,6 +30,17 @@ function mockData(data: unknown, error?: string) {
|
||||
}
|
||||
|
||||
describe("PrometheusGaugeWidget", () => {
|
||||
it("renders skeleton while loading", () => {
|
||||
vi.mocked(useWidgets.useWidgetData).mockReturnValue({
|
||||
data: undefined,
|
||||
isLoading: true,
|
||||
} as unknown as ReturnType<typeof useWidgets.useWidgetData>);
|
||||
render(<PrometheusGaugeWidget widget={widget} refreshIntervalMs={30000} />);
|
||||
expect(
|
||||
document.querySelector('[data-slot="skeleton"]'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders a gauge with value and threshold bands", () => {
|
||||
mockData({
|
||||
value: 0.75,
|
||||
|
||||
@@ -30,6 +30,17 @@ function mockData(data: unknown, error?: string) {
|
||||
}
|
||||
|
||||
describe("PrometheusMeanWidget", () => {
|
||||
it("renders skeleton while loading", () => {
|
||||
vi.mocked(useWidgets.useWidgetData).mockReturnValue({
|
||||
data: undefined,
|
||||
isLoading: true,
|
||||
} as unknown as ReturnType<typeof useWidgets.useWidgetData>);
|
||||
render(<PrometheusMeanWidget widget={widget} refreshIntervalMs={60000} />);
|
||||
expect(
|
||||
document.querySelector('[data-slot="skeleton"]'),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders the mean value with unit", () => {
|
||||
mockData({ value: 23.5, unit: "%" });
|
||||
render(<PrometheusMeanWidget widget={widget} refreshIntervalMs={60000} />);
|
||||
|
||||
Reference in New Issue
Block a user