Open History to see the last commit
1import { it as effectIt } from "@effect/vitest";
2import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
3import * as Effect from "effect/Effect";
4import { describe, expect, it, vi } from "vite-plus/test";
5
6import {
7 accessibleWindowElementTree,
8 accessibleWindowText,
9 capturedImageBounds,
10 compactAccessibilityTree,
11 findAccessibleWindow,
12 findCaptureSource,
13 hideAndWaitForBlur,
14 isWaylandSession,
15 snapShotShortcutRegistrationFailureMessage,
16 snapShotShortcutSystemConflict,
17 toElectronAccelerator,
18} from "./snapShot.ts";
19import { DesktopSnapShotError } from "./DesktopSnapShot.ts";
20
21describe("window capture errors", () => {
22 it.each([
23 ["unsupported", "SnapShots are not supported here."],
24 ["disabled", "Enable SnapShots in Settings first."],
25 ["no-window-selected", "No window was selected."],
26 ["window-unavailable", "The active window is not available for capture."],
27 ["capture", "Could not capture the active window."],
28 ] as const)("keeps %s failures user-facing", (operation, message) => {
29 expect(new DesktopSnapShotError({ operation }).message).toBe(message);
30 });
31});
32
33describe("accessibleWindowText", () => {
34 it("keeps unique names and values in tree order", () => {
35 expect(
36 accessibleWindowText(
37 {
38 name: "Settings",
39 children: [
40 {
41 name: "General",
42 children: [],
43 },
44 {
45 name: "Name",
46 value: "Bilal",
47 children: [],
48 },
49 ],
50 },
51 100,
52 ),
53 ).toBe("Settings\nGeneral\nName\nBilal");
54 });
55
56 it("caps large text without splitting a surrogate pair", () => {
57 expect(
58 accessibleWindowText(
59 {
60 value: "abc😀def",
61 children: [],
62 },
63 5,
64 ),
65 ).toBe("abc😀");
66 });
67
68 it("stops traversing very large trees", () => {
69 expect(
70 accessibleWindowText(
71 {
72 children: [
73 ...Array.from({ length: 10_000 }, () => ({ children: [] })),
74 { value: "past node limit", children: [] },
75 ],
76 },
77 100,
78 ),
79 ).not.toContain("past node limit");
80 });
81});
82
83describe("accessibleWindowElementTree", () => {
84 it("maps element bounds into captured-image pixels and keeps semantic state", async () => {
85 const tree = await accessibleWindowElementTree(
86 {
87 role: "window",
88 name: "Editor",
89 bounds: { x: 100, y: 200, width: 800, height: 600 },
90 active: true,
91 children: async () => [
92 {
93 role: "button",
94 name: "Save",
95 description: "Save the document",
96 bounds: { x: 300, y: 350, width: 100, height: 50 },
97 focused: true,
98 actions: ["press", "press"],
99 children: async () => [],
100 },
101 ],
102 },
103 { x: 100, y: 200, width: 800, height: 600 },
104 { width: 1_600, height: 1_200 },
105 );
106
107 expect(tree).toEqual({
108 truncated: false,
109 root: {
110 role: "window",
111 name: "Editor",
112 bounds: { x: 0, y: 0, width: 1_600, height: 1_200 },
113 state: { active: true },
114 children: [
115 {
116 role: "button",
117 name: "Save",
118 description: "Save the document",
119 bounds: { x: 400, y: 300, width: 200, height: 100 },
120 state: { focused: true },
121 actions: ["press"],
122 children: [],
123 },
124 ],
125 },
126 });
127 });
128
129 it("uses null child bounds when a Wayland provider reports only the root origin", async () => {
130 const tree = await accessibleWindowElementTree(
131 {
132 role: "window",
133 bounds: { x: 0, y: 0, width: 800, height: 600 },
134 children: async () => [
135 {
136 role: "button",
137 name: "Save",
138 bounds: { x: 0, y: 0, width: 100, height: 50 },
139 children: async () => [],
140 },
141 ],
142 },
143 { x: 0, y: 0, width: 800, height: 600 },
144 { width: 1_600, height: 1_200 },
145 { locationsReliable: true, verifyDescendantLocations: true },
146 );
147
148 expect(tree?.root.bounds).toEqual({ x: 0, y: 0, width: 1_600, height: 1_200 });
149 expect(tree?.root.children[0]?.bounds).toBeNull();
150 });
151
152 it("keeps Wayland child bounds after observing real position variation", async () => {
153 const tree = await accessibleWindowElementTree(
154 {
155 role: "window",
156 bounds: { x: 0, y: 0, width: 800, height: 600 },
157 children: async () => [
158 {
159 role: "button",
160 name: "Save",
161 bounds: { x: 20, y: 30, width: 100, height: 50 },
162 children: async () => [],
163 },
164 ],
165 },
166 { x: 0, y: 0, width: 800, height: 600 },
167 { width: 1_600, height: 1_200 },
168 { locationsReliable: true, verifyDescendantLocations: true },
169 );
170
171 expect(tree?.root.children[0]?.bounds).toEqual({ x: 40, y: 60, width: 200, height: 100 });
172 });
173
174 it("does not mistake a title-bar offset for varying descendant positions", async () => {
175 const tree = await accessibleWindowElementTree(
176 {
177 role: "window",
178 bounds: { x: 100, y: 229, width: 800, height: 571 },
179 children: async () => [
180 {
181 role: "button",
182 name: "Save",
183 bounds: { x: 100, y: 229, width: 100, height: 50 },
184 children: async () => [],
185 },
186 ],
187 },
188 { x: 100, y: 200, width: 800, height: 600 },
189 { width: 1_600, height: 1_200 },
190 { locationsReliable: true, verifyDescendantLocations: true },
191 );
192 expect(tree?.root.children[0]?.bounds).toBeNull();
193 });
194
195 it("collapses anonymous wrapper chains and removes duplicate text fields", async () => {
196 const tree = await accessibleWindowElementTree(
197 {
198 role: "window",
199 name: "Editor",
200 bounds: { x: 0, y: 0, width: 800, height: 600 },
201 children: async () => [
202 {
203 role: "group",
204 bounds: { x: 0, y: 0, width: 800, height: 600 },
205 children: async () => [
206 {
207 role: "group",
208 bounds: { x: 0, y: 0, width: 800, height: 600 },
209 children: async () => [
210 {
211 role: "button",
212 name: "Save",
213 value: "Save",
214 description: "Save",
215 bounds: { x: 20, y: 30, width: 80, height: 24 },
216 actions: ["press"],
217 children: async () => [],
218 },
219 {
220 role: "group",
221 bounds: null,
222 children: async () => [],
223 },
224 ],
225 },
226 ],
227 },
228 ],
229 },
230 { x: 0, y: 0, width: 800, height: 600 },
231 { width: 800, height: 600 },
232 );
233
234 expect(tree?.root.children).toEqual([
235 {
236 role: "button",
237 name: "Save",
238 bounds: { x: 20, y: 30, width: 80, height: 24 },
239 actions: ["press"],
240 children: [],
241 },
242 ]);
243 });
244
245 it("marks trees truncated before their serialized payload grows without bound", async () => {
246 const tree = await accessibleWindowElementTree(
247 {
248 role: "window",
249 bounds: { x: 0, y: 0, width: 800, height: 600 },
250 children: async () =>
251 Array.from({ length: 10 }, (_, index) => ({
252 role: "text",
253 value: `${index}${"x".repeat(8_000)}`,
254 bounds: null,
255 children: async () => [],
256 })),
257 },
258 { x: 0, y: 0, width: 800, height: 600 },
259 { width: 800, height: 600 },
260 );
261
262 expect(tree?.truncated).toBe(true);
263 expect(tree?.root.children.length).toBeLessThan(10);
264 expect(JSON.stringify(tree).length).toBeLessThanOrEqual(32_000);
265 });
266
267 it.each(["name", "value", "description"] as const)(
268 "reports clipped %s text in partial trees",
269 async (field) => {
270 const tree = await accessibleWindowElementTree(
271 {
272 role: "window",
273 children: async () => [{ role: "text_area", [field]: "x".repeat(8_001) }],
274 },
275 { x: 0, y: 0, width: 800, height: 600 },
276 { width: 800, height: 600 },
277 );
278
279 expect(tree?.truncated).toBe(true);
280 expect(tree?.root.children[0]?.[field]?.length).toBeLessThan(8_001);
281 },
282 );
283});
284
285describe("compactAccessibilityTree", () => {
286 it("keeps anonymous groups that organize multiple semantic children", () => {
287 const compacted = compactAccessibilityTree({
288 role: "window",
289 bounds: { x: 0, y: 0, width: 800, height: 600 },
290 children: [
291 {
292 role: "group",
293 bounds: { x: 0, y: 0, width: 800, height: 100 },
294 children: [
295 { role: "button", name: "Back", bounds: null, children: [] },
296 { role: "button", name: "Forward", bounds: null, children: [] },
297 ],
298 },
299 ],
300 });
301
302 expect(compacted.root.children[0]?.role).toBe("group");
303 expect(compacted.root.children[0]?.children).toHaveLength(2);
304 });
305});
306
307describe("capturedImageBounds", () => {
308 it("clips locations to the attached image", () => {
309 expect(
310 capturedImageBounds(
311 { x: 50, y: 150, width: 200, height: 200 },
312 { x: 100, y: 200, width: 800, height: 600 },
313 { width: 1_600, height: 1_200 },
314 ),
315 ).toEqual({ x: 0, y: 0, width: 300, height: 300 });
316 });
317
318 it("returns null when an accessibility provider omits a location", () => {
319 expect(
320 capturedImageBounds(
321 null,
322 { x: 0, y: 0, width: 800, height: 600 },
323 { width: 800, height: 600 },
324 ),
325 ).toBeNull();
326 });
327});
328
329describe("findAccessibleWindow", () => {
330 const captured = {
331 title: "Editor",
332 bounds: { x: 100, y: 200, width: 800, height: 600 },
333 };
334
335 it("matches one window by its captured bounds", () => {
336 const windows = [
337 { name: "Private", bounds: { x: 0, y: 0, width: 400, height: 300 } },
338 { name: "Editor", bounds: { x: 101, y: 199, width: 800, height: 601 } },
339 ];
340
341 expect(findAccessibleWindow(windows, captured)).toBe(windows[1]);
342 });
343
344 it("uses the matched source title when macOS omits the active title", () => {
345 const windows = [{ name: "Editor", bounds: captured.bounds }];
346 expect(
347 findAccessibleWindow(windows, {
348 ...captured,
349 title: "",
350 sourceTitle: "Editor",
351 }),
352 ).toBe(windows[0]);
353 });
354
355 it("uses the captured source title when the active title changed", () => {
356 const windows = [{ name: "Editor — saved", bounds: captured.bounds }];
357
358 expect(
359 findAccessibleWindow(windows, {
360 ...captured,
361 title: "Editor — saving",
362 sourceTitle: "Editor — saved",
363 }),
364 ).toBe(windows[0]);
365 });
366
367 it("uses the active match to disambiguate equal windows", () => {
368 const windows = [
369 { name: "Editor", bounds: captured.bounds, active: false },
370 { name: "Editor", bounds: captured.bounds, active: true },
371 ];
372
373 expect(findAccessibleWindow(windows, captured)).toBe(windows[1]);
374 });
375
376 it("does not match equal bounds with a different title", () => {
377 expect(
378 findAccessibleWindow(
379 [{ name: "Private", bounds: { x: 100, y: 200, width: 800, height: 600 } }],
380 captured,
381 ),
382 ).toBeUndefined();
383 });
384
385 it("does not use a title match when the bounds differ", () => {
386 expect(
387 findAccessibleWindow(
388 [{ name: "Editor", bounds: { x: 0, y: 0, width: 800, height: 600 } }],
389 captured,
390 ),
391 ).toBeUndefined();
392 });
393
394 it("matches a Wayland window whose accessibility provider omits its screen position", () => {
395 const captured = {
396 title: "hello world (Draft) - Text Editor",
397 bounds: { x: 479, y: 342, width: 700, height: 520 },
398 };
399 const windows = [{ name: captured.title, bounds: { x: 0, y: 0, width: 700, height: 520 } }];
400
401 expect(findAccessibleWindow(windows, captured, "wayland")).toBe(windows[0]);
402 expect(findAccessibleWindow(windows, captured)).toBeUndefined();
403 });
404
405 it("matches a decorated Wayland window by its verified client size", () => {
406 const clientBounds = { x: 100, y: 229, width: 800, height: 571 };
407 const windows = [{ name: captured.title, bounds: { ...clientBounds, x: 0, y: 0 } }];
408 expect(findAccessibleWindow(windows, { ...captured, clientBounds }, "wayland")).toBe(
409 windows[0],
410 );
411 expect(findAccessibleWindow(windows, { ...captured, clientBounds })).toBeUndefined();
412 expect(findAccessibleWindow(windows, captured, "wayland")).toBeUndefined();
413 });
414
415 it("does not guess between client-size and frame-size matches", () => {
416 const clientBounds = { x: 100, y: 229, width: 800, height: 571 };
417 const windows = [
418 { name: captured.title, bounds: clientBounds },
419 { name: captured.title, bounds: captured.bounds },
420 ];
421 expect(findAccessibleWindow(windows, { ...captured, clientBounds }, "wayland")).toBeUndefined();
422 expect(
423 findAccessibleWindow(
424 [
425 { name: "Private", bounds: clientBounds },
426 { name: captured.title, bounds: { ...clientBounds, height: 550 } },
427 ],
428 { ...captured, clientBounds },
429 "wayland",
430 ),
431 ).toBeUndefined();
432 });
433
434 it("distinguishes same-title Wayland windows by size", () => {
435 const windows = [
436 { name: "Editor", bounds: { x: 0, y: 0, width: 400, height: 300 } },
437 { name: "Editor", bounds: { x: 0, y: 0, width: 801, height: 599 } },
438 ];
439
440 expect(findAccessibleWindow(windows, captured, "wayland")).toBe(windows[1]);
441 });
442
443 it.each([
444 { name: "Private", bounds: { x: 0, y: 0, width: 800, height: 600 } },
445 { name: "Editor", bounds: { x: 0, y: 0, width: 400, height: 600 } },
446 { name: "Editor", bounds: { x: 0, y: 0, width: 800, height: 300 } },
447 { name: "Editor", bounds: null },
448 ])("rejects an unverified Wayland window: %j", (window) => {
449 expect(findAccessibleWindow([window], captured, "wayland")).toBeUndefined();
450 });
451
452 it("rejects ambiguous Wayland windows even when one reports the captured screen position", () => {
453 const windows = [
454 { name: "Editor", bounds: captured.bounds },
455 { name: "Editor", bounds: { x: 0, y: 0, width: 800, height: 600 } },
456 ];
457
458 expect(findAccessibleWindow(windows, captured, "wayland")).toBeUndefined();
459 });
460
461 it("does not match an untitled Wayland window by size alone", () => {
462 const windows = [{ name: "", bounds: captured.bounds }];
463
464 expect(findAccessibleWindow(windows, { ...captured, title: "" }, "wayland")).toBeUndefined();
465 });
466
467 it.each(["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"])(
468 "ignores a leading Wayland title spinner frame %s",
469 (frame) => {
470 const windows = [{ name: `${frame} t3code`, bounds: captured.bounds }];
471
472 expect(findAccessibleWindow(windows, { ...captured, title: "⠋ t3code" }, "wayland")).toBe(
473 windows[0],
474 );
475 },
476 );
477
478 it.each([
479 ["⠋ t3code", "t3code"],
480 ["t3code", "⠙ t3code"],
481 ])("matches a Wayland spinner starting or stopping: %s → %s", (title, name) => {
482 const windows = [{ name, bounds: captured.bounds }];
483
484 expect(findAccessibleWindow(windows, { ...captured, title }, "wayland")).toBe(windows[0]);
485 });
486
487 it.each([
488 ["⠋ t3code", "⠙ private"],
489 ["t3code ⠋", "t3code ⠙"],
490 ["⠋t3code", "⠙t3code"],
491 ["⠁ t3code", "⠙ t3code"],
492 ["⠋", "⠋"],
493 ])("does not guess a Wayland title match: %s → %s", (title, name) => {
494 expect(
495 findAccessibleWindow([{ name, bounds: captured.bounds }], { ...captured, title }, "wayland"),
496 ).toBeUndefined();
497 });
498
499 it("rejects matching spinners when the window sizes differ", () => {
500 expect(
501 findAccessibleWindow(
502 [{ name: "⠙ t3code", bounds: { ...captured.bounds, width: 400 } }],
503 { ...captured, title: "⠋ t3code" },
504 "wayland",
505 ),
506 ).toBeUndefined();
507 });
508
509 it("rejects ambiguous normalized titles even if one matches the captured spinner exactly", () => {
510 const windows = [
511 { name: "⠋ t3code", bounds: captured.bounds },
512 { name: "⠙ t3code", bounds: captured.bounds },
513 ];
514
515 expect(
516 findAccessibleWindow(windows, { ...captured, title: "⠋ t3code" }, "wayland"),
517 ).toBeUndefined();
518 });
519
520 it("keeps exact title matching outside Wayland", () => {
521 expect(
522 findAccessibleWindow([{ name: "⠙ t3code", bounds: captured.bounds }], {
523 ...captured,
524 title: "⠋ t3code",
525 }),
526 ).toBeUndefined();
527 });
528});
529
530describe("hideAndWaitForBlur", () => {
531 it("waits for a delayed blur after hiding the window", async () => {
532 let blur: (() => void) | undefined;
533 let settled = false;
534 const hidden = hideAndWaitForBlur({
535 hide: () => undefined,
536 once: (_event, listener) => {
537 blur = listener;
538 },
539 removeListener: () => undefined,
540 }).then(() => {
541 settled = true;
542 });
543
544 await Promise.resolve();
545 expect(settled).toBe(false);
546 blur?.();
547 await hidden;
548 expect(settled).toBe(true);
549 });
550
551 it("rejects when the hidden window never blurs", async () => {
552 vi.useFakeTimers();
553 try {
554 let rejected = false;
555 const hidden = hideAndWaitForBlur({
556 hide: () => undefined,
557 once: () => undefined,
558 removeListener: () => undefined,
559 }).catch(() => {
560 rejected = true;
561 });
562
563 await vi.advanceTimersByTimeAsync(1_000);
564 expect(rejected).toBe(true);
565 await hidden;
566 } finally {
567 vi.useRealTimers();
568 }
569 });
570});
571
572describe("toElectronAccelerator", () => {
573 it("converts the default portable shortcut", () => {
574 expect(
575 toElectronAccelerator({
576 key: "2",
577 metaKey: false,
578 ctrlKey: false,
579 shiftKey: true,
580 altKey: false,
581 modKey: true,
582 }),
583 ).toBe("CommandOrControl+Shift+2");
584 });
585
586 it("maps the portable meta key to Super", () => {
587 expect(
588 toElectronAccelerator({
589 key: "k",
590 metaKey: true,
591 ctrlKey: false,
592 shiftKey: false,
593 altKey: false,
594 modKey: false,
595 }),
596 ).toBe("Super+K");
597 });
598
599 it("normalizes Electron key names", () => {
600 expect(
601 toElectronAccelerator({
602 key: "ArrowUp",
603 metaKey: false,
604 ctrlKey: true,
605 shiftKey: false,
606 altKey: true,
607 modKey: false,
608 }),
609 ).toBe("Control+Alt+Up");
610 });
611});
612
613describe("findCaptureSource", () => {
614 const sources = [
615 { id: "window:42:0", name: "Terminal" },
616 { id: "window:84:0", name: "Editor" },
617 ];
618
619 it("matches the native window id before its title", () => {
620 expect(
621 findCaptureSource(sources, {
622 id: 84,
623 title: "Changed title",
624 }),
625 ).toEqual(sources[1]);
626 });
627
628 it("falls back to a unique title match", () => {
629 expect(
630 findCaptureSource(sources, {
631 id: 100,
632 title: "Terminal",
633 }),
634 ).toEqual(sources[0]);
635 });
636
637 it("does not guess when a title is ambiguous", () => {
638 expect(
639 findCaptureSource(
640 [
641 { id: "window:42:0", name: "Editor" },
642 { id: "window:84:0", name: "Editor" },
643 ],
644 {
645 id: 100,
646 title: "Editor",
647 },
648 ),
649 ).toBeUndefined();
650 });
651});
652
653describe("isWaylandSession", () => {
654 it.each([
655 ["linux", { XDG_SESSION_TYPE: "wayland" }, true],
656 ["linux", { WAYLAND_DISPLAY: "wayland-0" }, true],
657 ["linux", { XDG_SESSION_TYPE: "x11" }, false],
658 ["darwin", { XDG_SESSION_TYPE: "wayland", WAYLAND_DISPLAY: "wayland-0" }, false],
659 ] as const)("detects %s session %o as portal=%s", (platform, environment, expected) => {
660 expect(isWaylandSession(platform, environment)).toBe(expected);
661 });
662
663 effectIt.effect(
664 "falls back to a live runtime directory socket when session variables are stripped",
665 () =>
666 Effect.gen(function* () {
667 if ((yield* HostProcessPlatform) !== "linux") return;
668 yield* Effect.promise(async () => {
669 const { mkdtemp, rm, writeFile } = await import("node:fs/promises");
670 const { createServer } = await import("node:net");
671 const { tmpdir } = await import("node:os");
672 const { join } = await import("node:path");
673 const runtimeDirectory = await mkdtemp(join(tmpdir(), "t3-wayland-"));
674 const socketPath = join(runtimeDirectory, "wayland-0");
675 const server = createServer();
676 try {
677 expect(isWaylandSession("linux", { XDG_RUNTIME_DIR: runtimeDirectory })).toBe(false);
678 await writeFile(socketPath, "");
679 expect(isWaylandSession("linux", { XDG_RUNTIME_DIR: runtimeDirectory })).toBe(false);
680 await rm(socketPath);
681 await new Promise<void>((resolve, reject) => {
682 server.once("error", reject);
683 server.listen(socketPath, resolve);
684 });
685 expect(isWaylandSession("linux", { XDG_RUNTIME_DIR: runtimeDirectory })).toBe(true);
686 expect(
687 isWaylandSession("linux", {
688 XDG_RUNTIME_DIR: runtimeDirectory,
689 XDG_SESSION_TYPE: "x11",
690 }),
691 ).toBe(false);
692 expect(isWaylandSession("linux", { XDG_RUNTIME_DIR: "/nonexistent-t3-test" })).toBe(
693 false,
694 );
695 } finally {
696 if (server.listening) {
697 await new Promise<void>((resolve, reject) => {
698 server.close((error) => (error ? reject(error) : resolve()));
699 });
700 }
701 await rm(runtimeDirectory, { recursive: true, force: true });
702 }
703 });
704 }),
705 );
706});
707
708describe("snapShotShortcutRegistrationFailureMessage", () => {
709 it("distinguishes a modifier listener failure from a reserved key chord", () => {
710 expect(
711 snapShotShortcutRegistrationFailureMessage({ kind: "both-shift-keys" }, "darwin"),
712 ).toMatch(/Shift \+ Shift is not available/);
713 expect(
714 snapShotShortcutRegistrationFailureMessage(
715 { kind: "modifier-pair", modifier: "meta" },
716 "darwin",
717 ),
718 ).toMatch(/Command \+ Command is not available/);
719 expect(
720 snapShotShortcutRegistrationFailureMessage(
721 { kind: "modifier-pair", modifier: "meta" },
722 "linux",
723 ),
724 ).toMatch(/Super \+ Super is not available/);
725 expect(
726 snapShotShortcutRegistrationFailureMessage(
727 {
728 key: "2",
729 metaKey: false,
730 ctrlKey: false,
731 shiftKey: true,
732 altKey: false,
733 modKey: true,
734 },
735 "darwin",
736 ),
737 ).toMatch(/already used/);
738 });
739});
740
741describe("snapShotShortcutSystemConflict", () => {
742 it("blocks shortcuts that would break typing or common app actions", () => {
743 expect(
744 snapShotShortcutSystemConflict({
745 key: "s",
746 metaKey: false,
747 ctrlKey: false,
748 shiftKey: true,
749 altKey: false,
750 modKey: false,
751 }),
752 ).toMatch(/typing/);
753 expect(
754 snapShotShortcutSystemConflict({
755 key: "c",
756 metaKey: false,
757 ctrlKey: false,
758 shiftKey: false,
759 altKey: false,
760 modKey: true,
761 }),
762 ).toMatch(/Copy/);
763 });
764
765 it("allows a specific multi-modifier shortcut", () => {
766 expect(
767 snapShotShortcutSystemConflict({
768 key: "2",
769 metaKey: false,
770 ctrlKey: false,
771 shiftKey: true,
772 altKey: false,
773 modKey: true,
774 }),
775 ).toBeNull();
776 });
777});