aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:32:04 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:32:04 -0700
commitd04f10db5e3c007db2cd8a5f9e12eff55bc1c653 (patch)
tree0e9aba17a0eff7bb8f12b986427ea827ce9d7328 /tools
parentd31bdc6067841e0707baf7e2ad3bf90a823e730a (diff)
downloadcoinosv3-d04f10db5e3c007db2cd8a5f9e12eff55bc1c653.tar.gz
coinosv3-d04f10db5e3c007db2cd8a5f9e12eff55bc1c653.zip
profile-feed-test: the ⚡ lives in each note's action bar; holding it sets the amount
A tap pays the default amount at once (21 sats unless set), so the test holds the button to open the amount screen instead of tapping an empty wallet into a failed payment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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(' | '));