diff --git a/e2e/pwa.e2e.ts b/e2e/pwa.e2e.ts index 117991b..85767e0 100644 --- a/e2e/pwa.e2e.ts +++ b/e2e/pwa.e2e.ts @@ -165,6 +165,19 @@ test.describe('the version link', () => { }); test.describe('offline', () => { + test('says the site is ready to work offline once the first load has cached it, and not on later loads', async ({ page }) => { + await withSite(async (site) => { + await openAt(page, site); + + await expect(page.locator('#offline-status')).toHaveText('Ready to work offline.', { timeout: RESULT_TIMEOUT_MS }); + + await page.reload(); + await new Explorer(page).ready(); + + await expect(page.locator('#offline-status')).toHaveText(''); + }); + }); + test('opens, runs an operation and shows the engine with no network once it has been loaded', async ({ page }) => { await withSite(async (site) => { const explorer = await controlledPage(page, site); diff --git a/site/index.html b/site/index.html index 2424f4b..9838d19 100644 --- a/site/index.html +++ b/site/index.html @@ -134,6 +134,7 @@