summaryrefslogtreecommitdiffhomepage
path: root/vitest-setup.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-10-24 18:05:30 +0900
committerAdam Malczewski <[email protected]>2026-10-24 18:05:30 +0900
commitdaefad66bdf8dee132d701a3b43ce0d227dde241 (patch)
tree424ac806b3822247c0b835ee38ffabdf87f5016e /vitest-setup.ts
parentc8b2fb49835bde2f85d99a91b313e6a01ce1359c (diff)
parent0ba54b4455cb560cf7a82baf71b31ed129cfc29b (diff)
downloaddispatch-web-daefad66bdf8dee132d701a3b43ce0d227dde241.tar.gz
dispatch-web-daefad66bdf8dee132d701a3b43ce0d227dde241.zip
Merge branch 'feature/close-tab-cascade-subagents' into dev
Diffstat (limited to 'vitest-setup.ts')
-rw-r--r--vitest-setup.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/vitest-setup.ts b/vitest-setup.ts
index a0ace27..94aa5e8 100644
--- a/vitest-setup.ts
+++ b/vitest-setup.ts
@@ -42,3 +42,15 @@ if (typeof globalThis.PointerEvent === "undefined") {
}
globalThis.PointerEvent = PointerEventPolyfill as unknown as typeof PointerEvent;
}
+
+// jsdom has no native modal dialog lifecycle. Fake only this browser edge;
+// real-browser checks cover top-layer rendering and native focus containment.
+if (typeof HTMLDialogElement !== "undefined" && !HTMLDialogElement.prototype.showModal) {
+ HTMLDialogElement.prototype.showModal = function () {
+ this.open = true;
+ this.querySelector<HTMLElement>("button")?.focus();
+ };
+ HTMLDialogElement.prototype.close = function () {
+ this.open = false;
+ };
+}