web: open the catalogue without a version another tab can block

This commit is contained in:
2026-09-28 20:16:58 +07:00
parent 52732a17ee
commit 3aedd67ca0
3 changed files with 60 additions and 55 deletions
+27
View File
@@ -447,6 +447,33 @@ await page.waitForTimeout(300);
const walked = await page.$eval('[data-key="lib-strip"]', (el) => el.scrollLeft);
step('a wheel tick walks the strip along', shelf.sw > shelf.cw && walked > 0, `${shelf.sw}px of tiles in ${shelf.cw}px, scrolled to ${walked}`);
// A catalogue another tab has open — the tab that is still running yesterday's
// build, holding the connection the new build used to ask for a version on. The
// screen has to come up on it: the catalogue is opened as it is, with no version
// to reach for and nothing for the other tab to block.
const hold = await context.newPage();
await hold.route('**/assets/*.js', (r) => r.abort());
await hold.goto(`${base}/library`).catch(() => {});const held = await hold.evaluate(
() =>
new Promise((resolve, reject) => {
const req = indexedDB.open('recipescam-library');
req.onsuccess = () => {
window.__held = req.result;
resolve(req.result.version);
};
req.onerror = () => reject(req.error);
})
);
await page.setViewportSize({ width: 1280, height: 720 });
await page.goto(`${base}/library`);
await page.waitForSelector('[data-key="lib-node-CheckRoll"]', { timeout: 30_000 });
const seenAgain = await page.$$eval(thumbs, (els) => els.length);
step(
'a catalogue another tab is holding still comes up',
held >= 1 && seenAgain === 3,
`held at version ${held}, ${seenAgain} tiles on the other tab`
);
await browser.close();
sampleServer.close();
app.kill('SIGTERM');