-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.test.tsx
More file actions
83 lines (68 loc) · 3.18 KB
/
Copy pathApp.test.tsx
File metadata and controls
83 lines (68 loc) · 3.18 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// @vitest-environment jsdom
import { cleanup, render, screen } from "@testing-library/react";
import { afterEach, describe, expect, it } from "vitest";
import { App } from "./App";
afterEach(() => {
cleanup();
window.history.replaceState({}, "", "/");
});
describe("RELIC peripheral HUD", () => {
it("uses one 576 by 288 canvas as the only visible HUD surface", () => {
render(<App autoStart={false} />);
const hud = screen.getByTestId("hud-frame");
const canvas = screen.getByRole("img", { name: "RELIC HUD 안경 프레임" });
expect(hud.getAttribute("data-logical-size")).toBe("576x288");
expect(hud.dataset.textContainers).toBe("1");
expect(hud.dataset.imageContainers).toBe("4");
expect(canvas.tagName).toBe("CANVAS");
expect(canvas.getAttribute("width")).toBe("576");
expect(canvas.getAttribute("height")).toBe("288");
});
it("keeps mock information inside the raster instead of native text", () => {
render(<App autoStart={false} />);
expect(screen.queryByText("14:37")).toBeNull();
expect(screen.queryByText("다음 교차로에서 우회전")).toBeNull();
});
it("selects the official raw-byte diagnostic from its dedicated path", () => {
window.history.replaceState({}, "", "/diagnostic-v6");
render(<App autoStart={false} />);
const hud = screen.getByTestId("hud-frame");
expect(screen.getByText(/OFFICIAL SAMPLE\.PNG · RAW BYTES/)).toBeTruthy();
expect(hud.dataset.textContainers).toBe("2");
expect(hud.dataset.imageContainers).toBe("1");
});
it("selects the click-triggered BMP diagnostic from the v10 path", () => {
window.history.replaceState({}, "", "/diagnostic-v10");
render(<App autoStart={false} />);
expect(screen.getByText(/1-BIT BMP · CLICK TO SEND/)).toBeTruthy();
});
it("selects the four-tile maximum-boundary calibration route", () => {
window.history.replaceState({}, "", "/calibration-max");
render(<App autoStart={false} />);
const hud = screen.getByTestId("hud-frame");
expect(screen.getByText(/576×288 MAX BOUNDARY/)).toBeTruthy();
expect(hud.dataset.textContainers).toBe("1");
expect(hud.dataset.imageContainers).toBe("4");
});
it("selects the dense Canvas HUD with the proven four-tile layout", () => {
window.history.replaceState({}, "", "/hud-canvas");
render(<App autoStart={false} />);
const hud = screen.getByTestId("hud-frame");
expect(screen.getByText(/576×288 · CANVAS HUD/)).toBeTruthy();
expect(hud.dataset.renderer).toBe("canvas");
expect(hud.dataset.textContainers).toBe("1");
expect(hud.dataset.imageContainers).toBe("4");
expect(hud.dataset.pages).toBe("4");
expect(screen.getByText(/SCROLL · 4 PAGES/)).toBeTruthy();
});
it("isolates the static Canvas plus native Text experiment", () => {
window.history.replaceState({}, "", "/hud-hybrid");
render(<App autoStart={false} />);
const hud = screen.getByTestId("hud-frame");
expect(screen.getByText(/STATIC CANVAS \+ NATIVE TEXT/)).toBeTruthy();
expect(hud.dataset.renderer).toBe("hybrid");
expect(hud.dataset.textContainers).toBe("1");
expect(hud.dataset.imageContainers).toBe("4");
expect(hud.dataset.pages).toBe("4");
});
});