aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/harness
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-21 19:53:33 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-21 19:53:33 +0200
commit9f3445d03f106ee3ebd8b4b1bd546a08d9169af7 (patch)
treefabae2b4c9e2fee75a73c5ba1479075be908a584 /packages/meshbay-hub/tests/harness
parent24b563d0073849d0ba74c3fce9822a70c98e9d9f (diff)
downloadmeshbay-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/harness')
-rw-r--r--packages/meshbay-hub/tests/harness/playlist_ui_probe.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/meshbay-hub/tests/harness/playlist_ui_probe.py b/packages/meshbay-hub/tests/harness/playlist_ui_probe.py
index e6f99f7..c705244 100644
--- a/packages/meshbay-hub/tests/harness/playlist_ui_probe.py
+++ b/packages/meshbay-hub/tests/harness/playlist_ui_probe.py
@@ -180,11 +180,9 @@ const clickMenu = async (i) => {
['encrypt', 'decrypt']),
v2hkdf: await crypto.subtle.importKey('raw', raw, 'HKDF', false, ['deriveKey']),
};
- // Deleting a playlist asks. A modal dialog blocks the page and would wedge
- // the probe, so the answer is stubbed rather than the question avoided —
- // `confirm` is what the application really calls.
+ // Deleting a playlist asks, in the page (ask.js) — so the probe answers the
+ // dialog the way a person would, by clicking its OK button.
let asked = null;
- window.confirm = (q) => { asked = q; return true; };
render(html`<${Harness} />`, document.getElementById('root'));
@@ -282,6 +280,13 @@ const clickMenu = async (i) => {
await openToolbar();
await clickLabel(t('playlists.delete'));
await clickLabel('Soirée');
+ for (let i = 0; i < 40 && !asked; i++) {
+ const dlg = document.querySelector('[role=alertdialog]');
+ if (dlg) {
+ asked = dlg.querySelector('.ask-message').textContent;
+ dlg.querySelector('button[type=submit]').click();
+ } else await sleep(50);
+ }
await sleep(300);
steps.push({ step: 'deleted', asked: !!asked,
lists: (await P.listPlaylists('u1')).map((p) => p.name) });