@intentius/behold 0.30.1 → 0.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +31 -1
- package/README.md +11 -6
- package/dist/cli.js +1516 -840
- package/example-choudoufu-estate/chant.workspace.json +1 -1
- package/example-terraform-estate/README.md +1 -1
- package/example-terraform-estate/chant.workspace.json +1 -1
- package/example-terralith/README.md +1 -1
- package/example-three-cloud/package-lock.json +19 -19
- package/example-three-cloud/package.json +4 -4
- package/package.json +5 -5
- package/web/app.js +263 -16
- package/web/embed.js +2 -2
- package/web/event-help-modal.js +18 -12
- package/web/event-help-modal.test.js +28 -1
- package/web/index.html +18 -0
- package/web/kiosk-ask-layout.js +85 -0
- package/web/kiosk-ask-layout.test.js +83 -0
- package/web/kiosk-ask-tips.js +467 -0
- package/web/kiosk-ask-tips.test.js +359 -0
- package/web/kiosk-ask.js +774 -0
- package/web/kiosk-ask.test.js +593 -0
- package/web/kiosk-banner.js +108 -0
- package/web/kiosk-banner.test.js +72 -0
- package/web/kiosk-center-cards.test.js +110 -0
- package/web/kiosk-estate-scene.js +203 -0
- package/web/kiosk-estate-scene.test.js +21 -0
- package/web/kiosk-event-help.js +4 -1
- package/web/kiosk-graph-pane.js +63 -0
- package/web/kiosk-graph-pane.test.js +105 -0
- package/web/kiosk-light-frame.js +196 -0
- package/web/kiosk-light.js +509 -0
- package/web/kiosk-light.test.js +297 -0
- package/web/kiosk-metrics.js +7 -4
- package/web/kiosk-modal-sticky.test.js +2 -1
- package/web/kiosk-refit.test.js +81 -0
- package/web/kiosk-reset.js +49 -0
- package/web/kiosk-reset.test.js +11 -0
- package/web/kiosk-shot.js +40 -2
- package/web/kiosk-shot.test.js +23 -1
- package/web/kiosk-vendor.js +85 -7
- package/web/kiosk-vendor.test.js +9 -9
- package/web/kiosk-watch.js +8 -4
- package/web/kiosk.html +107 -1
- package/web/kiosk.js +149 -23
- package/web/kiosk.test.js +25 -1
- package/web/small-stage.test.js +4 -0
- package/web/terragucci-change.js +30 -13
- package/web/tool-mark.js +4 -4
- package/web/tool-mark.test.js +1 -1
- package/web/vendors/atmos.svg +1 -0
- package/web/vendors/chant.svg +1 -0
- package/web/vendors/choudoufu.svg +1 -0
- package/web/vendors/terragrunt.svg +9 -0
- package/web/vendors/terragucci.svg +1 -0
- package/web/vendors/choudoufu-128.png +0 -0
- package/web/vendors/choudoufu-64.png +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { badgeWords, bare, cardTitle, dependentsOf, lightMessage, planOf, producerOf, selectLight, slotState, startKioskLight, stateFile, stateMarks, unknownSlots } from "./kiosk-light.js";
|
|
5
|
+
|
|
6
|
+
// The three-root estate of behold#937 (src/__fixtures__/terragucci-demo-ask): network creates a subnet,
|
|
7
|
+
// app puts four resources in it, edge reads an address of app's. The answer is built the way the
|
|
8
|
+
// overlay builds /api/terragucci from the report: one card per changed resource, a mark on each.
|
|
9
|
+
const FIX = join(import.meta.dirname, "..", "src", "__fixtures__", "terragucci-demo-ask");
|
|
10
|
+
const read = (f) => JSON.parse(readFileSync(join(FIX, f), "utf8"));
|
|
11
|
+
const report = read("report-pull-request.json");
|
|
12
|
+
|
|
13
|
+
function answerOf(r) {
|
|
14
|
+
const roots = r.roots.map((x) => ({ member: "demo", name: x.path, path: x.path }));
|
|
15
|
+
const cards = {};
|
|
16
|
+
for (const root of r.roots) {
|
|
17
|
+
for (const c of root.changes) {
|
|
18
|
+
cards[`demo/${root.path}/${c.address}`] = [{ verdict: "plan", action: c.action, addresses: [c.address], values: (c.attributes || []).map((a) => ({ ...a, address: c.address })) }];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const reads = r.roots.flatMap((x) => (x.reads || []).map((rd) => ({ ...rd, root: x.path })));
|
|
22
|
+
return { roots, cards, unmatched: { roots: [], changes: [] }, pull_request: { roots: r.roots.map((x) => x.path), reads, blast: r.blast, waves: r.waves } };
|
|
23
|
+
}
|
|
24
|
+
const answer = answerOf(report);
|
|
25
|
+
const progressOf = (run) => ({ states: run.waves.map((w) => ({ number: w.number, state: w.state, roots: w.roots, composed: w.composed })), reads: run.roots.map((x) => ({ root: x.root, wave: x.wave, reads: x.reads, stateKey: x.state && x.state.key })) });
|
|
26
|
+
|
|
27
|
+
describe("which resources a step lights (behold#937)", () => {
|
|
28
|
+
const plan = planOf(answer);
|
|
29
|
+
|
|
30
|
+
it("reads the changed resources as <root>/<address>, with the card each is", () => {
|
|
31
|
+
expect([...plan.resources.keys()].sort()).toEqual(["app/terraform_data.queue", "app/terraform_data.schedule", "app/terraform_data.service", "app/terraform_data.worker", "edge/terraform_data.route", "network/terraform_data.subnet"]);
|
|
32
|
+
expect(plan.resources.get("network/terraform_data.subnet")).toMatchObject({ cardId: "demo/network/terraform_data.subnet", name: "subnet", type: "terraform_data", action: "create" });
|
|
33
|
+
expect(plan.edges).toEqual([{ from: "network", to: "app" }, { from: "app", to: "edge" }]);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("lights the named nodes alone when the step has no paths", () => {
|
|
37
|
+
const sel = selectLight(plan, { light: ["network/terraform_data.subnet"] });
|
|
38
|
+
expect(sel).toMatchObject({ seeds: ["network/terraform_data.subnet"], dependents: 0, cardIds: ["demo/network/terraform_data.subnet"], roots: ["network"] });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("follows the reads and the blast radius downstream with paths, and counts what depends on the seed", () => {
|
|
42
|
+
const sel = selectLight(plan, { light: ["network/terraform_data.subnet"], paths: true });
|
|
43
|
+
expect(sel.dependents).toBe(5);
|
|
44
|
+
expect(sel.lit.sort()).toEqual([...plan.resources.keys()].sort());
|
|
45
|
+
expect(sel.cardIds).toHaveLength(6);
|
|
46
|
+
expect(sel.roots.sort()).toEqual(["app", "edge", "network"]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("lights only what is downstream of a seed in the middle", () => {
|
|
50
|
+
const sel = selectLight(plan, { light: ["app/terraform_data.service"], paths: true });
|
|
51
|
+
expect(sel.roots.sort()).toEqual(["app", "edge"]);
|
|
52
|
+
expect(sel.lit).toContain("edge/terraform_data.route");
|
|
53
|
+
expect(sel.lit).not.toContain("network/terraform_data.subnet");
|
|
54
|
+
expect(selectLight(plan, { light: ["edge/terraform_data.route"], paths: true }).dependents).toBe(0);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it("skips an address that matches nothing, never an error, and lights nothing when none match", () => {
|
|
58
|
+
const sel = selectLight(plan, { light: ["network/terraform_data.nope", "network/terraform_data.subnet"] });
|
|
59
|
+
expect(sel.skipped).toEqual(["network/terraform_data.nope"]);
|
|
60
|
+
expect(sel.seeds).toEqual(["network/terraform_data.subnet"]);
|
|
61
|
+
expect(selectLight(plan, { light: ["network/terraform_data.nope"], paths: true })).toBeNull();
|
|
62
|
+
expect(selectLight(plan, { prompt: "x" })).toBeNull();
|
|
63
|
+
expect(selectLight(plan, null)).toBeNull();
|
|
64
|
+
expect(selectLight(planOf(null), { light: ["a/b"] })).toBeNull();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("matches an address with or without its instance key", () => {
|
|
68
|
+
const withKey = planOf({ ...answer, cards: { ...answer.cards, "demo/app/terraform_data.service": [{ verdict: "plan", action: "create", addresses: ['terraform_data.service["a"]'], values: [] }] } });
|
|
69
|
+
expect(selectLight(withKey, { light: ["app/terraform_data.service"] }).seeds).toEqual(['app/terraform_data.service["a"]']);
|
|
70
|
+
expect(bare('x.y["a.b"]')).toBe("x.y");
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("gives {dependents} only for a step with paths", () => {
|
|
74
|
+
expect(dependentsOf(answer, null, { light: ["network/terraform_data.subnet"], paths: true })).toBe(5);
|
|
75
|
+
expect(dependentsOf(answer, null, { light: ["network/terraform_data.subnet"], paths: true, reply: "x" })).toBe(5);
|
|
76
|
+
expect(dependentsOf(answer, null, { light: ["network/terraform_data.subnet"] })).toBeNull();
|
|
77
|
+
expect(dependentsOf(answer, null, { light: ["nope/x"], paths: true })).toBe(0);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("counts a change that has no card yet (a resource the checkout does not declare)", () => {
|
|
81
|
+
const a = { ...answer, cards: {}, unmatched: { roots: [], changes: [{ root: "network", address: "terraform_data.subnet", action: "create", verdict: "plan" }, { root: "app", address: "terraform_data.service", action: "create", verdict: "plan" }, { root: "app", address: "terraform_data.old", action: "update", verdict: "drift" }] } };
|
|
82
|
+
const sel = selectLight(planOf(a), { light: ["network/terraform_data.subnet"], paths: true });
|
|
83
|
+
expect(sel).toMatchObject({ dependents: 1, cardIds: [] });
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("names a card by its resource first and its type second", () => {
|
|
87
|
+
expect(cardTitle("terraform_data.subnet")).toEqual({ name: "subnet", type: "terraform_data" });
|
|
88
|
+
expect(cardTitle('module.m.aws_s3_bucket.logs["eu"]')).toEqual({ name: 'logs["eu"]', type: "aws_s3_bucket" });
|
|
89
|
+
expect(cardTitle("data.terraform_remote_state.network")).toEqual({ name: "network", type: "terraform_remote_state" });
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe("the pane's events (behold#936 and behold#937)", () => {
|
|
94
|
+
const fake = () => {
|
|
95
|
+
const t = new EventTarget();
|
|
96
|
+
t.sent = [];
|
|
97
|
+
return t;
|
|
98
|
+
};
|
|
99
|
+
const ev = (type, ask) => new CustomEvent(type, { detail: { ask, step: "planned", scenario: "compose-create" } });
|
|
100
|
+
|
|
101
|
+
it("sets the tokens at ask-start, lights at ask-done and clears at ask-clear", () => {
|
|
102
|
+
const win = fake();
|
|
103
|
+
const sent = [];
|
|
104
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => answer, getProgress: () => null, win });
|
|
105
|
+
const ask = { prompt: "Show me", light: ["network/terraform_data.subnet"], paths: true, ghost: false };
|
|
106
|
+
win.dispatchEvent(ev("behold:ask-start", ask));
|
|
107
|
+
expect(win.beholdAskTokens).toEqual({ dependents: 5 });
|
|
108
|
+
expect(sent).toEqual([{ type: "behold:hold" }]); // the graph holds still until the reply is done
|
|
109
|
+
sent.length = 0;
|
|
110
|
+
win.dispatchEvent(ev("behold:ask-done", ask));
|
|
111
|
+
expect(sent).toHaveLength(1);
|
|
112
|
+
expect(sent[0]).toMatchObject({ type: "behold:light", labels: true, lit: true, ghost: false });
|
|
113
|
+
expect(sent[0].ids).toHaveLength(6);
|
|
114
|
+
win.dispatchEvent(ev("behold:ask-clear", null));
|
|
115
|
+
expect(sent[1]).toMatchObject({ lit: false, ids: [], ghost: false });
|
|
116
|
+
expect(win.beholdAskTokens).toEqual({});
|
|
117
|
+
expect(sent[1].token).not.toBe(sent[0].token);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("lights at ask-light, as the reply starts, and does not light the same beat again at ask-done", () => {
|
|
121
|
+
const win = fake();
|
|
122
|
+
const sent = [];
|
|
123
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => answer, getProgress: () => null, win });
|
|
124
|
+
const ask = { prompt: "Show me", light: ["network/terraform_data.subnet"], paths: true, ghost: false };
|
|
125
|
+
win.dispatchEvent(ev("behold:ask-start", ask));
|
|
126
|
+
sent.length = 0;
|
|
127
|
+
win.dispatchEvent(ev("behold:ask-light", ask));
|
|
128
|
+
expect(sent).toHaveLength(1);
|
|
129
|
+
expect(sent[0]).toMatchObject({ type: "behold:light", lit: true });
|
|
130
|
+
win.dispatchEvent(ev("behold:ask-done", ask));
|
|
131
|
+
expect(sent).toHaveLength(1);
|
|
132
|
+
// A beat whose light never came is still lit when its reply is done.
|
|
133
|
+
const other = { prompt: "And?", light: ["network/terraform_data.subnet"] };
|
|
134
|
+
win.dispatchEvent(ev("behold:ask-done", other));
|
|
135
|
+
expect(sent).toHaveLength(2);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it("holds the graph when a step begins, so a status-only step lets nothing through (turns)", () => {
|
|
139
|
+
const win = fake();
|
|
140
|
+
const sent = [];
|
|
141
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => answer, getProgress: () => null, win });
|
|
142
|
+
win.dispatchEvent(ev("behold:ask-hold", null));
|
|
143
|
+
expect(sent).toEqual([{ type: "behold:hold" }]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("clears the lighting on a beat without light, and passes the ghost through", () => {
|
|
147
|
+
const win = fake();
|
|
148
|
+
const sent = [];
|
|
149
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => answer, getProgress: () => null, win });
|
|
150
|
+
win.dispatchEvent(ev("behold:ask-done", { prompt: "Now", ghost: true }));
|
|
151
|
+
expect(sent[0]).toMatchObject({ lit: false, ghost: true });
|
|
152
|
+
win.dispatchEvent(ev("behold:ask-start", { prompt: "Now" }));
|
|
153
|
+
expect(win.beholdAskTokens).toEqual({});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it("lights the moment its reads are in: asks again soon rather than waiting for a poll (behold#940)", () => {
|
|
157
|
+
const win = fake();
|
|
158
|
+
const timers = [];
|
|
159
|
+
win.setTimeout = (fn, ms) => timers.push({ fn, ms });
|
|
160
|
+
const sent = [];
|
|
161
|
+
let held = { roots: answer.roots, cards: {}, unmatched: { roots: [], changes: [] } };
|
|
162
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => held, getProgress: () => null, win });
|
|
163
|
+
win.dispatchEvent(ev("behold:ask-done", { light: ["network/terraform_data.subnet"], paths: true }));
|
|
164
|
+
expect(sent).toHaveLength(1);
|
|
165
|
+
expect(sent[0]).toMatchObject({ lit: false });
|
|
166
|
+
expect(timers).toHaveLength(1);
|
|
167
|
+
// The reads arrive; the next look lights, and stops looking.
|
|
168
|
+
held = answer;
|
|
169
|
+
timers.shift().fn();
|
|
170
|
+
expect(sent).toHaveLength(2);
|
|
171
|
+
expect(sent[1]).toMatchObject({ lit: true });
|
|
172
|
+
expect(sent[1].token).not.toBe(sent[0].token);
|
|
173
|
+
expect(timers).toHaveLength(0);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("stops looking when a newer beat has come (behold#940)", () => {
|
|
177
|
+
const win = fake();
|
|
178
|
+
const timers = [];
|
|
179
|
+
win.setTimeout = (fn, ms) => timers.push({ fn, ms });
|
|
180
|
+
const sent = [];
|
|
181
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => ({ roots: answer.roots, cards: {}, unmatched: { roots: [], changes: [] } }), getProgress: () => null, win });
|
|
182
|
+
win.dispatchEvent(ev("behold:ask-done", { light: ["network/terraform_data.subnet"] }));
|
|
183
|
+
win.dispatchEvent(ev("behold:ask-clear", null));
|
|
184
|
+
const before = sent.length;
|
|
185
|
+
timers.shift().fn();
|
|
186
|
+
expect(sent).toHaveLength(before);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("tells a frame that reloaded the last message when it has drawn", () => {
|
|
190
|
+
const win = fake();
|
|
191
|
+
const sent = [];
|
|
192
|
+
startKioskLight({ post: (m) => sent.push(m), getAnswer: () => answer, getProgress: () => null, win });
|
|
193
|
+
win.dispatchEvent(new MessageEvent("message", { data: { type: "behold:drawn" } }));
|
|
194
|
+
expect(sent).toEqual([]);
|
|
195
|
+
win.dispatchEvent(ev("behold:ask-done", { light: ["network/terraform_data.subnet"] }));
|
|
196
|
+
win.dispatchEvent(new MessageEvent("message", { data: { type: "behold:drawn" } }));
|
|
197
|
+
expect(sent).toHaveLength(2);
|
|
198
|
+
expect(lightMessage(null, null, 3)).toMatchObject({ lit: false, ids: [], roots: [] });
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe("each state's file, written mark and look (behold#937)", () => {
|
|
203
|
+
it("names a state by its backend key from run.json, else from the root's path", () => {
|
|
204
|
+
const p = progressOf(read("run-applied.json"));
|
|
205
|
+
expect(stateFile("network", p)).toEqual({ file: "network/terraform.tfstate", from: "run" });
|
|
206
|
+
expect(stateFile("network", null)).toEqual({ file: "network.tfstate", from: "path" });
|
|
207
|
+
expect(stateFile("envs/prod/app", { reads: [] })).toEqual({ file: "app.tfstate", from: "path" });
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it("marks every state written and applied when the run applied", () => {
|
|
211
|
+
const m = stateMarks(answer, progressOf(read("run-applied.json")));
|
|
212
|
+
for (const root of ["network", "app", "edge"]) expect(m[root]).toMatchObject({ written: true, look: "applied" });
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it("gives a failed composed run three looks: applied, partly applied, not applied", () => {
|
|
216
|
+
const m = stateMarks(answer, progressOf(read("run-failed.json")));
|
|
217
|
+
expect(m.network).toMatchObject({ look: "applied", written: true });
|
|
218
|
+
expect(m.app).toMatchObject({ look: "partial", written: true });
|
|
219
|
+
expect(m.edge).toMatchObject({ look: "not-applied", written: false });
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it("shows no look and no mark while the apply has not ended or has not started", () => {
|
|
223
|
+
for (const f of ["run-applying.json", "run-waiting.json"]) {
|
|
224
|
+
const m = stateMarks(answer, progressOf(read(f)));
|
|
225
|
+
for (const root of ["network", "app", "edge"]) expect(m[root]).toMatchObject({ look: null, written: false });
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it("labels the states from the path before any run exists", () => {
|
|
230
|
+
const m = stateMarks(answer, null);
|
|
231
|
+
expect(m.app).toMatchObject({ file: "app.tfstate", from: "path", written: false, look: null });
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
describe("the unknown slot and its filling (behold#937)", () => {
|
|
236
|
+
const plan = planOf(answer);
|
|
237
|
+
|
|
238
|
+
it("marks app's inputs as not known until the subnet exists", () => {
|
|
239
|
+
const slots = unknownSlots(plan);
|
|
240
|
+
const app = slots.filter((s) => s.root === "app");
|
|
241
|
+
expect(app.map((s) => s.address).sort()).toEqual(["terraform_data.queue", "terraform_data.schedule", "terraform_data.service", "terraform_data.worker"]);
|
|
242
|
+
for (const s of app) expect(s).toMatchObject({ path: "input", producer: "network/terraform_data.subnet", text: "not known until subnet exists" });
|
|
243
|
+
// The subnet's own id is a slot it fills itself; a known before and after (edge's route) is no slot.
|
|
244
|
+
expect(slots.find((s) => s.root === "network")).toMatchObject({ path: "output", producer: "network/terraform_data.subnet" });
|
|
245
|
+
expect(slots.some((s) => s.root === "edge")).toBe(false);
|
|
246
|
+
expect(producerOf(plan, plan.resources.get("network/terraform_data.subnet")).key).toBe("network/terraform_data.subnet");
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it("falls back to the created resource of the root it reads when the report has no blast radius", () => {
|
|
250
|
+
const a = { ...answer, pull_request: { ...answer.pull_request, blast: undefined } };
|
|
251
|
+
const p = planOf(a);
|
|
252
|
+
expect(unknownSlots(p).find((s) => s.address === "terraform_data.worker").producer).toBe("network/terraform_data.subnet");
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("is empty until the producer's root has applied, then filled with no value when only run.json says so", () => {
|
|
256
|
+
const slot = unknownSlots(plan).find((s) => s.root === "app");
|
|
257
|
+
expect(slotState(slot, answer, progressOf(read("run-waiting.json")))).toEqual({ filled: false });
|
|
258
|
+
expect(slotState(slot, answer, progressOf(read("run-applying.json")))).toEqual({ filled: false });
|
|
259
|
+
expect(slotState(slot, answer, progressOf(read("run-applied.json")))).toEqual({ filled: true });
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it("shows the applied value when an apply-time report states one", () => {
|
|
263
|
+
const slot = unknownSlots(plan).find((s) => s.address === "terraform_data.service");
|
|
264
|
+
const a = { ...answer, applied: { [slot.cardId]: { values: [{ path: "input", after: "subnet-0a1b", address: slot.address }], run: {} } } };
|
|
265
|
+
expect(slotState(slot, a, progressOf(read("run-applied.json")))).toEqual({ filled: true, value: "subnet-0a1b" });
|
|
266
|
+
expect(slotState(slot, a, progressOf(read("run-applying.json")))).toEqual({ filled: false });
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
it("finds no applied value in the fixtures' run.json or apply report (recorded on behold#937)", () => {
|
|
270
|
+
const run = read("run-applied.json");
|
|
271
|
+
expect(JSON.stringify(run)).not.toMatch(/"(after|value|values|outputs)"/);
|
|
272
|
+
const apply = read("../terragucci-demo-composed/report-apply-wave-1-failed.json");
|
|
273
|
+
for (const r of apply.roots) for (const c of r.changes) for (const at of c.attributes || []) if (at.unknown === true) expect(at).not.toHaveProperty("after");
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
describe("ask mode's badge and a producer's own value (behold#940)", () => {
|
|
278
|
+
const composed = { state: "planned", words: "wave 1 \u00b7 planned, composed" };
|
|
279
|
+
const done = { states: [{ number: 1, state: "applied", roots: ["network"], composed: { members: [{ root: "network", apply: "applied", state: "written" }] } }], reads: [] };
|
|
280
|
+
|
|
281
|
+
it("says planned together, then applied together, with no wave in it", () => {
|
|
282
|
+
expect(badgeWords(composed, "network", null)).toBe("planned together");
|
|
283
|
+
// The badge follows the root's outcome even where the wave's own state still reads planned.
|
|
284
|
+
expect(badgeWords(composed, "network", done)).toBe("applied together");
|
|
285
|
+
expect(badgeWords({ state: "applied", words: "wave 1 \u00b7 applied, composed" }, "app", null)).toBe("applied together");
|
|
286
|
+
expect(badgeWords({ state: "planned", words: "wave 2 \u00b7 planned" }, "app", null)).toBe("planned");
|
|
287
|
+
expect(badgeWords({ state: "unchanged", words: "wave 1 \u00b7 unchanged" }, "app", null)).toBe("unchanged");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it("shows the subnet's own id when the exact attribute is not stated, and nothing invented for another card", () => {
|
|
291
|
+
const own = { key: "network/terraform_data.subnet", cardId: "c", path: "output", producer: "network/terraform_data.subnet", producerRoot: "network" };
|
|
292
|
+
const a = { applied: { c: { values: [{ address: "x", path: "id", after: "subnet-0a1b2c" }] } } };
|
|
293
|
+
expect(slotState(own, a, done)).toEqual({ filled: true, value: "subnet-0a1b2c", path: "id" });
|
|
294
|
+
const other = { ...own, key: "app/terraform_data.service", producer: "network/terraform_data.subnet" };
|
|
295
|
+
expect(slotState(other, a, done)).toEqual({ filled: true });
|
|
296
|
+
});
|
|
297
|
+
});
|
package/web/kiosk-metrics.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// The delivery numbers on the demo are the loop's own (terragucci's
|
|
14
14
|
// stack/demo.sh runs terragucci estate after each cycle's audit): demo.json's
|
|
15
15
|
// `delivery` line says so over them, and the section shows no line without one.
|
|
16
|
+
import { composedRun } from "./kiosk-light.js";
|
|
16
17
|
|
|
17
18
|
/** The localStorage key of the viewer's fold. */
|
|
18
19
|
export const METRICS_STORE = "behold.kiosk.metrics";
|
|
@@ -146,11 +147,12 @@ export function metricsModel(answer, delivery = null, asked = null) {
|
|
|
146
147
|
if (rows.length) dora = rows;
|
|
147
148
|
}
|
|
148
149
|
if (!run && !dora) return null;
|
|
149
|
-
const
|
|
150
|
+
const composed = composedRun(answer);
|
|
151
|
+
const n = run && !composed ? run.waves.length : 0;
|
|
150
152
|
const count = [n ? `${n} ${n === 1 ? "wave" : "waves"}` : null, dora ? `${dora.length} delivery` : null].filter(Boolean).join(" · ");
|
|
151
153
|
const note = dora && typeof delivery === "string" && delivery.trim() ? delivery.trim() : null;
|
|
152
154
|
const span = dora ? spanWords(answer.dora.span_seconds) : null;
|
|
153
|
-
return { count, run, dora, ...(note ? { note } : {}), ...(span ? { window: `last ${span}`, windowNote: windowNote(span) } : {}) };
|
|
155
|
+
return { count, run, dora, ...(composed ? { composed } : {}), ...(note ? { note } : {}), ...(span ? { window: `last ${span}`, windowNote: windowNote(span) } : {}) };
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
/**
|
|
@@ -169,9 +171,10 @@ export function steadyModel(prev, next, { same = false, failed = false } = {}) {
|
|
|
169
171
|
const note = next.note || (next.dora ? null : prev.note) || null;
|
|
170
172
|
// The window goes with the numbers it is about.
|
|
171
173
|
const span = next.dora ? next : prev;
|
|
172
|
-
const
|
|
174
|
+
const composed = next.composed || prev.composed || false;
|
|
175
|
+
const n = run && !composed ? run.waves.length : 0;
|
|
173
176
|
const count = [n ? `${n} ${n === 1 ? "wave" : "waves"}` : null, dora ? `${dora.length} delivery` : null].filter(Boolean).join(" · ");
|
|
174
|
-
return { count, run, dora, ...(note ? { note } : {}), ...(span.window ? { window: span.window, windowNote: span.windowNote } : {}) };
|
|
177
|
+
return { count, run, dora, ...(composed ? { composed } : {}), ...(note ? { note } : {}), ...(span.window ? { window: span.window, windowNote: span.windowNote } : {}) };
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
/** The viewer's fold: true open, false folded, null when they never chose. */
|
|
@@ -281,8 +281,9 @@ function fakeDoc() {
|
|
|
281
281
|
prepend(c) {
|
|
282
282
|
n.appendChild(c);
|
|
283
283
|
},
|
|
284
|
-
replaceChildren() {
|
|
284
|
+
replaceChildren(...kids) {
|
|
285
285
|
n.children = [];
|
|
286
|
+
for (const k of kids) n.appendChild(k);
|
|
286
287
|
},
|
|
287
288
|
setAttribute() {},
|
|
288
289
|
addEventListener(ev, fn) {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { PAGE_TIMERS, REFIT_WAIT_MS, afterFrames, debounced } from "./kiosk-shot.js";
|
|
3
|
+
|
|
4
|
+
const fakeTimers = () => {
|
|
5
|
+
let now = 0;
|
|
6
|
+
let next = 1;
|
|
7
|
+
const pending = new Map();
|
|
8
|
+
return {
|
|
9
|
+
set: (fn, ms) => (pending.set(next, { fn, at: now + ms }), next++),
|
|
10
|
+
clear: (id) => pending.delete(id),
|
|
11
|
+
advance(ms) {
|
|
12
|
+
now += ms;
|
|
13
|
+
for (const [id, t] of [...pending]) if (t.at <= now) (pending.delete(id), t.fn());
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe("refit trigger", () => {
|
|
19
|
+
it("runs once, after the last size change of a burst", () => {
|
|
20
|
+
const t = fakeTimers();
|
|
21
|
+
const runs = [];
|
|
22
|
+
const refit = debounced(() => runs.push(1), REFIT_WAIT_MS, t);
|
|
23
|
+
refit();
|
|
24
|
+
t.advance(60);
|
|
25
|
+
refit();
|
|
26
|
+
t.advance(60);
|
|
27
|
+
refit();
|
|
28
|
+
t.advance(REFIT_WAIT_MS - 1);
|
|
29
|
+
expect(runs).toHaveLength(0);
|
|
30
|
+
t.advance(1);
|
|
31
|
+
expect(runs).toHaveLength(1);
|
|
32
|
+
t.advance(1000);
|
|
33
|
+
expect(runs).toHaveLength(1);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("cancel drops a pending run", () => {
|
|
37
|
+
const t = fakeTimers();
|
|
38
|
+
const runs = [];
|
|
39
|
+
const refit = debounced(() => runs.push(1), 100, t);
|
|
40
|
+
refit();
|
|
41
|
+
refit.cancel();
|
|
42
|
+
t.advance(500);
|
|
43
|
+
expect(runs).toHaveLength(0);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("afterFrames waits two animation frames by default", () => {
|
|
47
|
+
const queue = [];
|
|
48
|
+
const raf = (fn) => queue.push(fn);
|
|
49
|
+
let done = 0;
|
|
50
|
+
afterFrames(raf, () => done++);
|
|
51
|
+
expect(done).toBe(0);
|
|
52
|
+
queue.shift()();
|
|
53
|
+
expect(done).toBe(0);
|
|
54
|
+
queue.shift()();
|
|
55
|
+
expect(done).toBe(1);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("runs on the page's own timers by default (a bare setTimeout in the timers object threw Illegal invocation)", () => {
|
|
59
|
+
vi.useFakeTimers();
|
|
60
|
+
try {
|
|
61
|
+
const runs = [];
|
|
62
|
+
const refit = debounced(() => runs.push(1));
|
|
63
|
+
expect(() => refit()).not.toThrow();
|
|
64
|
+
vi.advanceTimersByTime(REFIT_WAIT_MS);
|
|
65
|
+
expect(runs).toHaveLength(1);
|
|
66
|
+
refit();
|
|
67
|
+
refit.cancel();
|
|
68
|
+
vi.advanceTimersByTime(1000);
|
|
69
|
+
expect(runs).toHaveLength(1);
|
|
70
|
+
} finally {
|
|
71
|
+
vi.useRealTimers();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it("the default timers are methods that work detached from a window", () => {
|
|
76
|
+
// What throws in a browser: timers.set(...) with `this` the timers object. Calling through a plain object proves it.
|
|
77
|
+
const holder = { set: PAGE_TIMERS.set, clear: PAGE_TIMERS.clear };
|
|
78
|
+
const id = holder.set(() => {}, 5);
|
|
79
|
+
expect(() => holder.clear(id)).not.toThrow();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prompt demo's reset (behold#935). Between acts the driver puts every estate back to its base, outside the
|
|
3
|
+
* story the person drives. In ask mode the reset step shows one modal over the page, "Resetting", so a viewer knows
|
|
4
|
+
* what the wait is; it goes when the next step arrives. Nothing in the pane or the graph changes for it.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Whether the reset modal shows for this step: a reset while the page is in ask mode. */
|
|
8
|
+
export function resetShown(demo, askOn) {
|
|
9
|
+
return !!askOn && !!demo && demo.step === "reset";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const STYLE_ID = "k-reset-style";
|
|
13
|
+
const STYLE = `
|
|
14
|
+
#k-reset { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 300ms ease; }
|
|
15
|
+
#k-reset.on { opacity: 1; pointer-events: auto; }
|
|
16
|
+
#k-reset .k-reset-card { background: var(--panel, #1f2335); color: var(--fg, #cdd6f4); border: 1px solid var(--accent, #89b4fa); border-radius: 10px; padding: 22px 30px; text-align: center; max-width: min(90vw, 420px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); }
|
|
17
|
+
#k-reset .k-reset-title { font: 700 1.4rem/1.2 system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 0.6em; }
|
|
18
|
+
#k-reset .k-reset-spin { width: 0.9em; height: 0.9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: k-reset-spin 900ms linear infinite; }
|
|
19
|
+
#k-reset .k-reset-line { margin-top: 10px; font: 0.95rem/1.4 system-ui, sans-serif; color: var(--muted, #a6adc8); }
|
|
20
|
+
@keyframes k-reset-spin { to { transform: rotate(360deg); } }
|
|
21
|
+
@media (prefers-reduced-motion: reduce) { #k-reset { transition: none; } #k-reset .k-reset-spin { animation: none; } }
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
/** The modal, made once in `doc`; `set(on)` shows or hides it. */
|
|
25
|
+
export function mountResetModal(doc = document) {
|
|
26
|
+
if (!doc.getElementById(STYLE_ID)) {
|
|
27
|
+
const style = doc.createElement("style");
|
|
28
|
+
style.id = STYLE_ID;
|
|
29
|
+
style.textContent = STYLE;
|
|
30
|
+
doc.head.appendChild(style);
|
|
31
|
+
}
|
|
32
|
+
let el = doc.getElementById("k-reset");
|
|
33
|
+
if (!el) {
|
|
34
|
+
el = doc.createElement("div");
|
|
35
|
+
el.id = "k-reset";
|
|
36
|
+
el.setAttribute("role", "status");
|
|
37
|
+
el.setAttribute("aria-live", "polite");
|
|
38
|
+
el.innerHTML =
|
|
39
|
+
'<div class="k-reset-card"><div class="k-reset-title"><span class="k-reset-spin" aria-hidden="true"></span>Resetting</div>' +
|
|
40
|
+
'<div class="k-reset-line">Network, app and edge go back to how they started.</div></div>';
|
|
41
|
+
doc.body.appendChild(el);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
set(on) {
|
|
45
|
+
el.classList.toggle("on", !!on);
|
|
46
|
+
el.setAttribute("aria-hidden", on ? "false" : "true");
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { resetShown } from "./kiosk-reset.js";
|
|
3
|
+
|
|
4
|
+
describe("the reset modal", () => {
|
|
5
|
+
it("shows for a reset step in ask mode, and for nothing else", () => {
|
|
6
|
+
expect(resetShown({ step: "reset" }, true)).toBe(true);
|
|
7
|
+
expect(resetShown({ step: "reset" }, false)).toBe(false);
|
|
8
|
+
expect(resetShown({ step: "applied" }, true)).toBe(false);
|
|
9
|
+
expect(resetShown(null, true)).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
});
|
package/web/kiosk-shot.js
CHANGED
|
@@ -10,6 +10,9 @@ export const SHOT_MS = 750;
|
|
|
10
10
|
/** The most a shot zooms in: one svg unit to this many pixels. */
|
|
11
11
|
export const SHOT_MAX_SCALE = 1.3;
|
|
12
12
|
|
|
13
|
+
/** behold#939: the most a prompt-driven step zooms in, so the graph fills the room above the pane. */
|
|
14
|
+
export const ASK_MAX_SCALE = 8;
|
|
15
|
+
|
|
13
16
|
/** Room kept round a shot's target, in svg units. */
|
|
14
17
|
export const SHOT_PAD = 36;
|
|
15
18
|
|
|
@@ -18,7 +21,7 @@ export const SHOT_PAD = 36;
|
|
|
18
21
|
* pixels. `room`: the caption's tallest in the cycle, as a bottom inset in px
|
|
19
22
|
* (web/kiosk-watch.js captionRoom), which only a held small stage keeps.
|
|
20
23
|
*/
|
|
21
|
-
export function shotMessage({ roots = [], waves = [], whole = false, insets = {}, ms = SHOT_MS, id = null, room = 0 } = {}) {
|
|
24
|
+
export function shotMessage({ roots = [], waves = [], whole = false, insets = {}, ms = SHOT_MS, id = null, room = 0, ask = false } = {}) {
|
|
22
25
|
const px = (v) => (Number.isFinite(v) && v > 0 ? Math.round(v) : 0);
|
|
23
26
|
return {
|
|
24
27
|
type: "behold:shot",
|
|
@@ -29,6 +32,8 @@ export function shotMessage({ roots = [], waves = [], whole = false, insets = {}
|
|
|
29
32
|
insets: { top: px(insets.top), right: px(insets.right), bottom: px(insets.bottom), left: px(insets.left) },
|
|
30
33
|
ms: Number.isFinite(ms) && ms >= 0 ? ms : SHOT_MS,
|
|
31
34
|
...(px(room) ? { room: px(room) } : {}),
|
|
35
|
+
// behold#939: a prompt-driven step's shot fills the room (the frame zooms in further, and drops its own caption line).
|
|
36
|
+
...(ask === true ? { ask: true } : {}),
|
|
32
37
|
};
|
|
33
38
|
}
|
|
34
39
|
|
|
@@ -40,7 +45,7 @@ export function shotFromMessage(event, host) {
|
|
|
40
45
|
// Inspect: no shot; the frame fits the graph as it always has.
|
|
41
46
|
if (d.release === true) return { type: "behold:shot", release: true };
|
|
42
47
|
const list = (v) => (Array.isArray(v) ? v : []);
|
|
43
|
-
return shotMessage({ roots: list(d.roots), waves: list(d.waves), whole: d.whole, insets: d.insets && typeof d.insets === "object" ? d.insets : {}, ms: d.ms, id: d.id ?? null, room: d.room });
|
|
48
|
+
return shotMessage({ roots: list(d.roots), waves: list(d.waves), whole: d.whole, insets: d.insets && typeof d.insets === "object" ? d.insets : {}, ms: d.ms, id: d.id ?? null, room: d.room, ask: d.ask === true });
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
/** The smallest box round several `{x, y, x2, y2}`, or null for none. */
|
|
@@ -255,3 +260,36 @@ export function heldFrame(held, { key, pane, insets = {}, target }) {
|
|
|
255
260
|
const box = same && target && reason !== "fill" ? unionBox([held.target, target]) : target;
|
|
256
261
|
return { key, pane: { width: pane.width, height: pane.height }, insets: room, target: box, vb: shotViewBox(box, pane, room, { pad: HELD_PAD, maxScale: HELD_MAX_SCALE }), reason };
|
|
257
262
|
}
|
|
263
|
+
|
|
264
|
+
/** How long after the last size change a refit waits, in ms: a drag or a Firefox resize burst refits once, at its end. */
|
|
265
|
+
export const REFIT_WAIT_MS = 120;
|
|
266
|
+
|
|
267
|
+
// The page's timers are called as methods of `timers`, and setTimeout is not a method of it: each is wrapped (a bare
|
|
268
|
+
// `{ set: setTimeout }` throws "Illegal invocation" on the first call, and the trailing refit then never ran).
|
|
269
|
+
export const PAGE_TIMERS = { set: (fn, ms) => setTimeout(fn, ms), clear: (id) => clearTimeout(id) };
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* `fn` run once, `wait` ms after the last call (trailing debounce). `.cancel()` drops a pending run. `timers` is for tests.
|
|
273
|
+
* The refit it guards sets the view directly: it never changes the box the observers watch, so it cannot loop.
|
|
274
|
+
*/
|
|
275
|
+
export function debounced(fn, wait = REFIT_WAIT_MS, timers = PAGE_TIMERS) {
|
|
276
|
+
let t = null;
|
|
277
|
+
const run = (...args) => {
|
|
278
|
+
if (t !== null) timers.clear(t);
|
|
279
|
+
t = timers.set(() => {
|
|
280
|
+
t = null;
|
|
281
|
+
fn(...args);
|
|
282
|
+
}, wait);
|
|
283
|
+
};
|
|
284
|
+
run.cancel = () => {
|
|
285
|
+
if (t !== null) timers.clear(t);
|
|
286
|
+
t = null;
|
|
287
|
+
};
|
|
288
|
+
return run;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** `fn` once, after `n` animation frames (two by default: layout and paint of what was just drawn have settled). */
|
|
292
|
+
export function afterFrames(raf, fn, n = 2) {
|
|
293
|
+
const step = (left) => raf(() => (left > 1 ? step(left - 1) : fn()));
|
|
294
|
+
step(n);
|
|
295
|
+
}
|
package/web/kiosk-shot.test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// behold#571: Watch mode's camera, as arithmetic: where a shot puts its
|
|
2
2
|
// target, how a move goes, and which messages the frame takes.
|
|
3
3
|
import { describe, expect, it } from "vitest";
|
|
4
|
-
import { HELD_CAPTION_PX, HELD_FILL, HELD_MAX_SCALE, HELD_PAD, HOLD_RESERVE_PX, SHOT_MS, SMALL_STAGE_CARD_PX, ease, heldFrame, heldInsets, heldTarget, holdsStage, medianWidth, sameViewBox, shotFromMessage, shotMessage, shotViewBox, smallStage, tweenViewBox, unionBox } from "./kiosk-shot.js";
|
|
4
|
+
import { ASK_MAX_SCALE, HELD_CAPTION_PX, HELD_FILL, HELD_MAX_SCALE, HELD_PAD, HOLD_RESERVE_PX, SHOT_MS, SMALL_STAGE_CARD_PX, ease, heldFrame, heldInsets, heldTarget, holdsStage, medianWidth, sameViewBox, shotFromMessage, shotMessage, shotViewBox, smallStage, tweenViewBox, unionBox } from "./kiosk-shot.js";
|
|
5
5
|
import { captionRoom, shotFor } from "./kiosk-watch.js";
|
|
6
6
|
|
|
7
7
|
const pane = { width: 1600, height: 900 };
|
|
@@ -299,3 +299,25 @@ describe("the held scale is the open stage over the graph, nothing else", () =>
|
|
|
299
299
|
expect(heldInsets({ bottom: 300 }, 245).bottom).toBe(300);
|
|
300
300
|
});
|
|
301
301
|
});
|
|
302
|
+
|
|
303
|
+
describe("a prompt-driven step's shot (behold#939)", () => {
|
|
304
|
+
it("carries ask only when true, and reads it back", () => {
|
|
305
|
+
expect(shotMessage({ whole: true })).not.toHaveProperty("ask");
|
|
306
|
+
expect(shotMessage({ whole: true, ask: true }).ask).toBe(true);
|
|
307
|
+
const ev = { origin: "http://h", data: shotMessage({ whole: true, ask: true }) };
|
|
308
|
+
expect(shotFromMessage(ev, "http://h").ask).toBe(true);
|
|
309
|
+
expect(shotFromMessage({ origin: "http://h", data: shotMessage({ whole: true }) }, "http://h")).not.toHaveProperty("ask");
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("zooms a small graph up to fill the room when allowed, and not past the usual cap otherwise", () => {
|
|
313
|
+
const target = { x: 0, y: 0, x2: 400, y2: 300 };
|
|
314
|
+
const pane = { width: 1920, height: 1080 };
|
|
315
|
+
const insets = { top: 20, bottom: 340, left: 20, right: 20 };
|
|
316
|
+
const usual = shotViewBox(target, pane, insets);
|
|
317
|
+
const ask = shotViewBox(target, pane, insets, { maxScale: ASK_MAX_SCALE });
|
|
318
|
+
expect(pane.width / usual[2]).toBeCloseTo(1.3, 5);
|
|
319
|
+
expect(pane.width / ask[2]).toBeGreaterThan(1.8);
|
|
320
|
+
// The graph still sits in the open part: its scaled height is within the room above the pane.
|
|
321
|
+
expect((300 + 72) * (pane.width / ask[2])).toBeLessThanOrEqual(1080 - 340 - 20 + 0.5);
|
|
322
|
+
});
|
|
323
|
+
});
|