diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/profile-pager-test.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/profile-pager-test.js b/tools/profile-pager-test.js index 2835b34..85aee86 100644 --- a/tools/profile-pager-test.js +++ b/tools/profile-pager-test.js @@ -94,19 +94,22 @@ try { check('her picture opens in the pager, on itself', await resting('a1.png'), await curPic()); const keys = await page.evaluate(() => [...document.querySelectorAll('.mp-slide')].map((s) => s.getAttribute('data-k').split('/').pop())); check('the pager holds her pictures only, in her timeline\'s order', JSON.stringify(keys) === JSON.stringify(['a1.png', 'a2.png', 'b.png', 'd.png']), JSON.stringify(keys)); + check('counter starts at the first post', await page.$eval('.mp-position', (e) => e.textContent) === '1 / 3'); await page.keyboard.press('ArrowRight'); check('right: the post\'s second picture', await resting('a2.png'), await curPic()); + check('sideways keeps the same post number', await page.$eval('.mp-position', (e) => e.textContent) === '1 / 3'); await page.keyboard.press('ArrowDown'); check('down: her next post with a picture', await resting('b.png'), await curPic()); + check('down advances by one post', await page.$eval('.mp-position', (e) => e.textContent) === '2 / 3'); 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 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('counter counts the first post once', await page.$eval('.mp-position', (e) => e.textContent) === '1 / 3'); 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'); + check('counter at the last post', await page.$eval('.mp-position', (e) => e.textContent) === '3 / 3'); 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(); |
