aboutsummaryrefslogtreecommitdiffstats
path: root/tools/media-grid-dups-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/media-grid-dups-test.js')
-rw-r--r--tools/media-grid-dups-test.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/media-grid-dups-test.js b/tools/media-grid-dups-test.js
index 948e727..205a4a5 100644
--- a/tools/media-grid-dups-test.js
+++ b/tools/media-grid-dups-test.js
@@ -94,6 +94,12 @@ try {
await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
check('the clips are in the feed', await waitFor(() => document.querySelectorAll('.notes-feed video.note-video').length >= 8, null, 20000));
await page.evaluate(() => document.querySelector('.media-mode[data-mode="videos"]').click());
+ // a desktop-sized window starts on every shape (justified rows, the tall clip in)
+ check('a desktop starts on every shape', await waitFor(() => !!document.querySelector('.media-grid.justified') && [...document.querySelectorAll('.media-grid .media-tile')].some((t) => t.getAttribute('data-key').endsWith('/tall.webm')), null, 15000));
+ // the rest starts from the screen's way round: wide only
+ await page.evaluate(() => { localStorage.setItem('coinos-clips-fit', 'fit'); document.querySelector('.media-mode[data-mode="images"]').click(); });
+ await sleep(300);
+ await page.evaluate(() => document.querySelector('.media-mode[data-mode="videos"]').click());
await waitFor(() => document.querySelectorAll('.media-grid .media-tile').length >= 3, null, 15000);
await waitFor(() => document.querySelectorAll('.media-grid .media-tile').length === 3, null, 8000);
await sleep(1500);
@@ -110,6 +116,7 @@ try {
await page.evaluate(() => document.querySelector('.mp-fit').click());
check('…and "All shapes" brings it in', await waitFor(() => { const s = [...document.querySelectorAll('.mp-slide')].find((x) => x.getAttribute('data-k').endsWith('/tall.webm')); return !!s && !s.closest('.mp-group').classList.contains('mp-off'); }, null, 3000));
await page.keyboard.press('Escape');
+ check('…which, being the desktop\'s default, is kept as no setting at all', await page.evaluate(() => localStorage.getItem('coinos-clips-fit') === null));
check('the grid has it too', await waitFor(() => [...document.querySelectorAll('.media-grid .media-tile')].some((t) => t.getAttribute('data-key').endsWith('/tall.webm')), null, 5000));
const rows = () => page.evaluate(() => {
const g = document.querySelector('.media-grid'), gw = g.getBoundingClientRect().width;