-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun-console.test.tsx
More file actions
61 lines (50 loc) · 1.66 KB
/
Copy pathrun-console.test.tsx
File metadata and controls
61 lines (50 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { describe, expect, it } from "@jest/globals";
import { render, screen } from "@testing-library/react";
jest.mock("../src/app/pipeline-status-context", () => ({
usePipelineStatus: () => ({
clearLog: () => undefined,
lastEmittedOutput: { path: "/out/2026-07-27.hdr" },
log: [
{
at: "2026-07-27T12:04:31.000Z",
kind: "step",
message: "Merging exposures",
step: "merge_exposures",
},
{
at: "2026-07-27T12:05:02.000Z",
kind: "warning",
message: "vignetting.cal is fixed size",
step: "cal_check",
},
],
payload: null,
progress: 62,
setIndex: 1,
setTotal: 3,
statusText: "Applying vignetting correction",
}),
}));
jest.mock("next/navigation", () => ({
useRouter: () => ({ push: () => undefined }),
}));
declare const jest: typeof import("@jest/globals").jest;
const SET_LINE = /Set 1 of 3/;
import { RunConsole } from "../src/app/pipeline/run-console";
describe("RunConsole", () => {
it("shows every log entry, not just the newest", () => {
render(<RunConsole onOpenChange={() => undefined} open />);
expect(screen.getByText("Merging exposures")).toBeInTheDocument();
expect(
screen.getByText("vignetting.cal is fixed size")
).toBeInTheDocument();
});
it("reports which set of how many is running", () => {
render(<RunConsole onOpenChange={() => undefined} open />);
expect(screen.getByText(SET_LINE)).toBeInTheDocument();
});
it("exposes the log as an accessible live region", () => {
render(<RunConsole onOpenChange={() => undefined} open />);
expect(screen.getByRole("log")).toBeInTheDocument();
});
});