aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/harness
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-12 12:57:49 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-12 12:57:49 +0200
commit13e7980071ab11b07b5d473e43506c6cb4ab637e (patch)
treec1a76c5125511c810f107dc110f09e7f0c5b9cc2 /packages/meshbay-hub/tests/harness
parent3324b4eb701e34f64e859dd90937793ccf7f75c5 (diff)
downloadmeshbay-13e7980071ab11b07b5d473e43506c6cb4ab637e.tar.gz
fix: keep the photo lightbox's close button on a phone screen
The bar was 457 px wide and pushed the close button to 397..437 px, off a 360 px phone. Delete leaves the lightbox (it stays on the tile's menu: right-click, or press and hold), and below 768 px the bar drops the file name, the zoom label and 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/harness')
-rwxr-xr-xpackages/meshbay-hub/tests/harness/photo_delete_probe.py32
1 files changed, 8 insertions, 24 deletions
diff --git a/packages/meshbay-hub/tests/harness/photo_delete_probe.py b/packages/meshbay-hub/tests/harness/photo_delete_probe.py
index a99566d..2c41b14 100755
--- a/packages/meshbay-hub/tests/harness/photo_delete_probe.py
+++ b/packages/meshbay-hub/tests/harness/photo_delete_probe.py
@@ -5,8 +5,8 @@ Deleting a photo from the Photos app, in a real browser.
Mounts the shipped `PhotosApp` on a made-up index, with a transport that
records what it is asked to delete and an index that drops what was deleted,
as a node's does. Right-clicks a tile, picks Delete, answers the page's own
-confirmation (ask.js) one way then the other, and does the same from the
-lightbox's bar.
+confirmation (ask.js) one way then the other, and checks the lightbox's bar
+offers none.
photo_delete_probe.py
@@ -109,16 +109,8 @@ const pick = async (label) => {
await wait(50);
return true;
};
-// The page's own confirmation: what it says, whether it is the topmost thing
-// on screen, and an answer.
+// The page's own confirmation: what it says, and an answer.
const dialog = () => document.querySelector('[role="alertdialog"]');
-const onTop = () => {
- const d = dialog();
- if (!d) return false;
- const r = d.getBoundingClientRect();
- const hit = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2);
- return Boolean(hit && d.contains(hit));
-};
const answer = async (yes) => {
const d = dialog();
const buttons = [...d.querySelectorAll('button')];
@@ -172,21 +164,12 @@ const answer = async (yes) => {
await closeMenus();
cases.push({ case: 'operator', delete_offered: all });
- // -- from the lightbox: the button, the dialog above it, the next photo --
+ // -- the lightbox: no delete button, the tile is where it is --
await mount({});
document.querySelectorAll('.photo-tile')[0].click();
await frame();
- const title = () => (document.querySelector('.photo-lightbox .video-title') || {}).textContent;
- const before = title();
- const btn = document.querySelector('.photo-lightbox button[aria-label="Delete"]');
- if (btn) btn.click();
- await wait(50);
- const dialogOnTop = onTop();
- if (dialog()) await answer(true);
- await wait(100); await frame();
- cases.push({ case: 'lightbox', button: Boolean(btn), dialog_on_top: dialogOnTop,
- before, after: title() || null, open: Boolean(document.querySelector('.photo-lightbox')),
- deleted: DELETED.map((d) => d[0]) });
+ cases.push({ case: 'lightbox', open: Boolean(document.querySelector('.photo-lightbox')),
+ button: Boolean(document.querySelector('.photo-lightbox button[aria-label="Delete"]')) });
// -- read-only (Search): never --
await mount({ readOnly: true, isNodeAdmin: true });
@@ -196,7 +179,8 @@ const answer = async (yes) => {
await closeMenus();
ro.click(); await frame();
cases.push({ case: 'read only', labels: roLabels,
- lightbox_button: Boolean(document.querySelector('.photo-lightbox button[aria-label="Delete"]')) });
+ lightbox_button: Boolean(
+ document.querySelector('.photo-lightbox button[aria-label="Delete"]')) });
parent.postMessage({ cases, logs: LOGS, origin: location.origin }, '*');
} catch (err) {