mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-14 17:42:17 +00:00
test(pokedex): cover shared dex loading and preview badges
Adds loadSharedPokedex unit tests and a share preview case for every badge, restoring the branch coverage gate. Gives the offline sync BDD poll 30s so a full Living Dex snapshot can finish caching on CI.
This commit is contained in:
@@ -67,16 +67,19 @@ When('I go offline and reload the sign-in page', async ({ page }) => {
|
||||
|
||||
Given('my offline copy is synchronized', async ({ page, state }) => {
|
||||
await waitForServiceWorker(page);
|
||||
// A full Living Dex snapshot plus its artwork can take longer than the default poll window on CI.
|
||||
await expect
|
||||
.poll(() =>
|
||||
page.evaluate(async (userId) => {
|
||||
const meta = await (
|
||||
await caches.open('livingdex-offline-meta-v1')
|
||||
).match('/__offline/current');
|
||||
if (!meta) return false;
|
||||
const value = await meta.json();
|
||||
return value.userId === userId;
|
||||
}, state.userId)
|
||||
.poll(
|
||||
() =>
|
||||
page.evaluate(async (userId) => {
|
||||
const meta = await (
|
||||
await caches.open('livingdex-offline-meta-v1')
|
||||
).match('/__offline/current');
|
||||
if (!meta) return false;
|
||||
const value = await meta.json();
|
||||
return value.userId === userId;
|
||||
}, state.userId),
|
||||
{ timeout: 30_000 }
|
||||
)
|
||||
.toBe(true);
|
||||
const serializedSnapshot = await page.evaluate(async () => {
|
||||
|
||||
Reference in New Issue
Block a user