Service worker verification — test offline caching works #33

Closed
opened 2026-03-25 22:26:02 +00:00 by mik-tf · 2 comments
Member

Current state

Containerfile.frontend injects sw.js + registration script. But no test verifies it works.

Tests needed

  1. Service worker registers successfully (check navigator.serviceWorker.ready)
  2. Static assets cached after first load
  3. Cached pages load when backend is unavailable
  4. API calls bypass cache (only static assets cached)

Implementation

Add Playwright test:

  • Load page → verify SW registered
  • Block network → reload → verify cached page loads
  • Verify /api/* requests are NOT cached

Signed-off-by: mik-tf

## Current state Containerfile.frontend injects sw.js + registration script. But no test verifies it works. ## Tests needed 1. Service worker registers successfully (check navigator.serviceWorker.ready) 2. Static assets cached after first load 3. Cached pages load when backend is unavailable 4. API calls bypass cache (only static assets cached) ## Implementation Add Playwright test: - Load page → verify SW registered - Block network → reload → verify cached page loads - Verify /api/* requests are NOT cached Signed-off-by: mik-tf
Author
Member

Roadmap position: 1/5 (v2.0 track, issue #26)

Previous baseline: v1.4.0
Next after this: → #32 (visual regression)

Signed-off-by: mik-tf

**Roadmap position: 1/5** (v2.0 track, issue #26) Previous baseline: v1.4.0 Next after this: → #32 (visual regression) Signed-off-by: mik-tf
Author
Member

Done — 3 tests pass

  1. sw.js served at root (200 OK, 474 bytes)
  2. Service worker registers in browser
  3. API calls bypass cache (/api/ excluded)

135 total tests ALL PASS.
7-layer pipeline followed.

Next: #32 (visual regression) [2/5]

Signed-off-by: mik-tf

## Done — 3 tests pass 1. sw.js served at root (200 OK, 474 bytes) 2. Service worker registers in browser ✅ 3. API calls bypass cache (/api/ excluded) ✅ 135 total tests ALL PASS. 7-layer pipeline followed. Next: #32 (visual regression) [2/5] Signed-off-by: mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coopcloud_code/home#33
No description provided.