diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-09-21 19:53:33 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-09-21 19:53:33 +0200 |
| commit | 9f3445d03f106ee3ebd8b4b1bd546a08d9169af7 (patch) | |
| tree | fabae2b4c9e2fee75a73c5ba1479075be908a584 /packages/meshbay-hub/tests/test_zip_size_limit.py | |
| parent | 24b563d0073849d0ba74c3fce9822a70c98e9d9f (diff) | |
| download | meshbay-9f3445d03f106ee3ebd8b4b1bd546a08d9169af7.tar.gz | |
fix: ask in the page instead of native confirm/alert
A native confirm() or alert() leaves the desktop client unable to type
until the window is refocused. ask.js draws both in the page; the SPA
test now bans all three browser dialogs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_zip_size_limit.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_zip_size_limit.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_zip_size_limit.py b/packages/meshbay-hub/tests/test_zip_size_limit.py index 26c5552..9243fd1 100644 --- a/packages/meshbay-hub/tests/test_zip_size_limit.py +++ b/packages/meshbay-hub/tests/test_zip_size_limit.py @@ -14,7 +14,7 @@ of allowance and nobody would ever notice. And that the two limits in play do not contradict each other: ZIP_MAX_BYTES (512 MB) bounds the archive, while MEMORY_CEILING (100 MB, test_memory_ceiling.py) bounds what may be built in the page — so a 400 MB zip is allowed when there is somewhere to stream it and -refused when the only route left is memory. The `confirm()` that offers the +refused when the only route left is memory. The `ask()` that offers the build-in-memory path therefore only ever appears below the ceiling. """ @@ -47,6 +47,11 @@ def _run(total_bytes, tmp_path, picker=False): (sandbox / src.name).write_text(src.read_text(encoding="utf-8"), encoding="utf-8") (tmp_path / "package.json").write_text('{"type":"module"}') + # ask.js draws a dialog in the DOM, which Node has none of; the question is + # answered here instead, exactly where `confirm` used to be stubbed. + (sandbox / "ask.js").write_text( + "export const ask = async (q) => globalThis.confirm(q);\n" + "export const tell = async () => {};\n", encoding="utf-8") script = tmp_path / "case.mjs" picker_js = "true" if picker else "false" |