Files
TimeTracker/tests/test_service_worker.py
T
Dries Peeters f54ab9934f feat(api): add broad API v1 parity, scope UI, and consistency improvements
Backend: add Black/isort/Flake8 configs and .editorconfig; switch health/readiness to locale-based time. Fix service worker asset list; add smoke test.

Admin scopes UI: add read:* and write:* wildcards; add granular scopes for invoices, expenses, payments, mileage, per diem, budget alerts, calendar, comments, recurring invoices.

API v1: add endpoints for invoices, expenses, payments, mileage, per diem (+rates), budget alerts, calendar, kanban, saved filters, time entry templates, comments, recurring invoices, credit notes, client notes (paginated), project costs (paginated), currencies, exchange rates, favorites, audit logs, activities, and invoice PDF/templates (admin). Extend /api/v1/info with all resources. No schema changes.

Tests: add coverage for new endpoints (CRUD/list/pagination) and service worker route smoke test.
2025-11-14 13:09:57 +01:00

15 lines
480 B
Python

import re
def test_service_worker_serves_assets(client):
resp = client.get('/service-worker.js')
assert resp.status_code == 200
text = resp.get_data(as_text=True)
# Ensure JS content type and presence of cache list with known asset
assert 'application/javascript' in (resp.headers.get('Content-Type') or '')
assert 'dist/output.css' in text
assert 'enhanced-ui.js' in text
# Basic sanity: ASSETS array present
assert 'const ASSETS=' in text