aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/profile-feed-test.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/profile-feed-test.js b/tools/profile-feed-test.js
index 266e3f8..8ea7faa 100644
--- a/tools/profile-feed-test.js
+++ b/tools/profile-feed-test.js
@@ -53,13 +53,27 @@ try {
const empty = !fed && (await bodyText()).includes('No recent posts');
check('note feed resolves', fed || empty, fed ? 'notes shown' : 'no posts for this pk');
if (fed) {
- const zaps = await page.evaluate(() => [...document.querySelectorAll('button')].filter((b) => b.textContent.trim() === '⚡').length);
+ // the ⚡ in every note's action bar, live when the wallet can pay
+ const zaps = await page.evaluate(() => [...document.querySelectorAll('.notes-feed button.note-zap')].filter((b) => b.getAttribute('aria-disabled') !== 'true').length);
check('zap buttons on notes', zaps > 0, `${zaps} note(s) zappable`);
const imgsBroken = await page.evaluate(() => [...document.querySelectorAll('.note-img')].some((i) => i.style.display !== 'none' && i.complete && i.naturalWidth === 0));
check('no broken inline images', !imgsBroken);
- // tap a zap: should land on the send tab's zap card (resolution ladder)
- await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === '⚡')?.click());
- check('zap flow opens', await waitText('Send a zap', 10000));
+ // A tap pays the default amount at once (this wallet is empty, so it
+ // would only fail); holding ⚡ opens the screen that sets the amount.
+ const box = await page.evaluate(() => {
+ const b = [...document.querySelectorAll('.notes-feed button.note-zap')].find((x) => x.getAttribute('aria-disabled') !== 'true');
+ if (!b) return null;
+ b.scrollIntoView({ block: 'center' });
+ const r = b.getBoundingClientRect();
+ return { x: r.x + r.width / 2, y: r.y + r.height / 2 };
+ });
+ if (box) {
+ await page.mouse.move(box.x, box.y);
+ await page.mouse.down();
+ await sleep(800);
+ await page.mouse.up();
+ }
+ check('zap flow opens', await waitText('Set your zap amount', 10000));
}
}
check('no page errors', pageErrors.length === 0, pageErrors.slice(0, 2).join(' | '));