feat: add app icons and PWA shell
CI / test (push) Successful in 2m40s

This commit is contained in:
strsv committed 2026-11-06 08:27:02 +03:00
1 parent 2fcb29e3fe
commit 97a5098511
23 files changed
+146 -57

No files matched your search

+21
View File
@@ -349,6 +349,27 @@ class ApiTests(unittest.TestCase):
self.assertTrue(content_type.startswith("image/jpeg"))
self.assertFalse(os.path.exists(marker))
def test_pwa_assets(self):
body, content_type, _ = self.raw_get("/static/site.webmanifest")
self.assertTrue(content_type.startswith("application/manifest+json"))
manifest = json.loads(body)
self.assertEqual(manifest["name"], "SteamBase")
self.assertEqual(manifest["start_url"], "/")
sizes = {icon["sizes"] for icon in manifest["icons"]}
self.assertEqual(sizes, {"192x192", "512x512"})
body, content_type, _ = self.raw_get("/sw.js")
self.assertTrue(content_type.startswith("application/javascript"))
self.assertIn(b"addEventListener", body)
body, content_type, _ = self.raw_get("/static/icon-192.png")
self.assertEqual(content_type, "image/png")
self.assertTrue(body.startswith(b"\x89PNG\r\n\x1a\n"))
html, _, _ = self.raw_get("/")
self.assertIn(b"site.webmanifest", html)
self.assertIn(b'id="themeToggle"', html)
def test_backup_download(self):
body, content_type, headers = self.raw_get("/api/backup")
self.assertEqual(content_type, "application/octet-stream")