aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_frontend.py9
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)