aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-14 23:21:55 -0700
committerAdam Soltys <[email protected]>2026-10-14 23:21:55 -0700
commit686309a584a8e7a13091cb194e42aa09e2aec5d5 (patch)
treee1e934385b262e5162686fa69743774dda099937 /tools
parent63d43428468bb5dc336006bc345769b071905204 (diff)
downloadcoinosv3-686309a584a8e7a13091cb194e42aa09e2aec5d5.tar.gz
coinosv3-686309a584a8e7a13091cb194e42aa09e2aec5d5.zip
Loop media pager through loaded posts and show position
Diffstat (limited to 'tools')
-rw-r--r--tools/profile-pager-test.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/profile-pager-test.js b/tools/profile-pager-test.js
index 9006bce..2835b34 100644
--- a/tools/profile-pager-test.js
+++ b/tools/profile-pager-test.js
@@ -60,7 +60,7 @@ const tapPager = async () => { const at = await page.evaluate(() => { const sc =
const rowTop = (word) => page.evaluate((w) => { const r = [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.textContent.includes(w)); return r ? Math.round(r.getBoundingClientRect().top) : null; }, word);
try {
- await page.setViewport({ width: 390, height: 844 });
+ await page.setViewport({ width: 390, height: 844, hasTouch: true });
await page.goto(server.url.href, { waitUntil: 'domcontentloaded' });
await page.evaluate(() => localStorage.setItem('btc-wallet-network', 'regtest'));
await page.reload({ waitUntil: 'domcontentloaded' });
@@ -101,8 +101,18 @@ try {
await page.keyboard.press('ArrowDown');
check('down again: her last', await resting('d.png'), await curPic());
await page.keyboard.press('ArrowDown'); await sleep(600);
- check('past her last: the end, not somebody else\'s picture', (await curPic()) !== 'x.png' && !(await page.evaluate(() => [...document.querySelectorAll('.mp-slide')].some((s) => s.getAttribute('data-k').endsWith('/x.png')))));
- await page.keyboard.press('ArrowUp'); await resting('d.png'); // back off the end
+ check('past her last wraps to her first post', await resting('a2.png'), await curPic());
+ check('counter follows sideways position', await page.$eval('.mp-position', (e) => e.textContent) === '2 / 4');
+ check('no loading slide', await page.$('.mp-tail') === null);
+ await page.keyboard.press('ArrowUp'); await resting('d.png');
+ check('up from first wraps to last', await curPic() === 'd.png');
+ check('counter at the last picture', await page.$eval('.mp-position', (e) => e.textContent) === '4 / 4');
+ await page.touchscreen.touchStart(195, 650);
+ for (let i = 1; i <= 8; i++) { await page.touchscreen.touchMove(195, 650 - 40 * i); await sleep(16); }
+ await page.touchscreen.touchEnd();
+ check('touch swipe wraps to first post', await resting('a2.png'), await curPic());
+ await page.evaluate(() => document.querySelector('.media-pager').dispatchEvent(new WheelEvent('wheel', { deltaY: -3, deltaMode: 1, bubbles: true, cancelable: true })));
+ check('wheel wraps back to last post', await resting('d.png'), await curPic());
await page.keyboard.press('ArrowUp');
check('up: her post before', await resting('b.png'), await curPic());
await page.keyboard.press('Escape');