diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-09 20:01:41 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-09 20:01:41 +0100 |
| commit | d107596f6c277d6aa4616616cc4fe176f339a8f5 (patch) | |
| tree | 3b0fecc9aab164cd4318610a232363ee4c8dfc5e /tests/test_frontend.py | |
| parent | ddc62adc923b2668207c4c7a527ed221c9ba9393 (diff) | |
| download | deck-it-d107596f6c277d6aa4616616cc4fe176f339a8f5.tar.gz deck-it-d107596f6c277d6aa4616616cc4fe176f339a8f5.zip | |
feat: PWA manifest so Chrome installs deck-it fullscreen
Diffstat (limited to 'tests/test_frontend.py')
| -rw-r--r-- | tests/test_frontend.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_frontend.py b/tests/test_frontend.py index d86468d..1111f89 100644 --- a/tests/test_frontend.py +++ b/tests/test_frontend.py @@ -4,6 +4,7 @@ from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import http.client +import json import os import socket import tempfile @@ -55,6 +56,14 @@ class Frontend(unittest.TestCase): for asset in ("app.js", "deck.css", "vendor/gridstack/gridstack-all.js"): self.assertIn(asset, text) + def test_pwa_manifest(self): + self.assertIn(b'rel="manifest"', self.get("/")[1]) + manifest = json.loads(self.get("/manifest.json")[1]) + self.assertEqual(manifest["display"], "fullscreen") + self.assertEqual(manifest["start_url"], "./") + for size in (192, 512): + self.assertEqual(self.get(f"/icon-{size}.png")[0], 200) + def test_vendor_assets_served(self): for path in ("/vendor/gridstack/gridstack-all.js", "/vendor/gridstack/gridstack.min.css"): self.assertEqual(self.get(path)[0], 200, path) |
