test(FN-4594): complete Step 3 — add scroll container regression assertion

Fusion-Task-Id: FN-4594
Fusion-Task-Lineage: 7c013fc5-084f-4391-ac87-865ac28ba87f
This commit is contained in:
Fusion
2026-05-15 06:34:16 -07:00
committed by gsxdsm
parent a866c3d115
commit 6bb5c7d2e0

View File

@@ -38,6 +38,28 @@ describe("ReliabilityView", () => {
expect(screen.getByText("2026-05-13")).toBeInTheDocument();
});
it("FN-4594: root container provides vertical scroll contract", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue({
ok: true,
json: async () => ({
windowDays: 7,
generatedAt: "2026-05-13T00:00:00.000Z",
headline: { inReviewFailureRate7d: 0.2 },
perDay: [],
duration: { p50Ms: 60_000, p95Ms: 120_000, sampleCount: 3 },
mergeAttempts: { mean: 1.2, max: 2, histogram: { "1": 1 } },
}),
} as Response);
const { container } = render(<ReliabilityView />);
const root = container.querySelector(".reliability-view");
expect(root).not.toBeNull();
const computed = getComputedStyle(root as HTMLElement);
expect(computed.overflowY).toBe("auto");
expect(computed.height).not.toBe("");
});
it("renders null headline reason gracefully", async () => {
vi.spyOn(globalThis, "fetch").mockResolvedValue({
ok: true,