feat: DSH编排基建首版(server/tests 88用例/P2插件/8020端口/PORT-NOTE/MOBILE_APP)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
"""PWA static endpoints: /app shell, /sw.js, /manifest.webmanifest, /icon.svg."""
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def test_sw_js_served(client):
|
||||
r = client.get("/sw.js")
|
||||
assert r.status_code == 200
|
||||
assert "text/javascript" in r.headers["content-type"]
|
||||
assert r.headers["cache-control"] == "no-cache"
|
||||
assert "dsh-shell-v1" in r.text and "dsh-api-v1" in r.text
|
||||
|
||||
|
||||
def test_manifest_served(client):
|
||||
r = client.get("/manifest.webmanifest")
|
||||
assert r.status_code == 200
|
||||
assert "manifest+json" in r.headers["content-type"]
|
||||
assert r.json()["start_url"] == "/app"
|
||||
assert r.json()["icons"][0]["src"] == "/icon.svg"
|
||||
|
||||
|
||||
def test_icon_served(client):
|
||||
r = client.get("/icon.svg")
|
||||
assert r.status_code == 200
|
||||
assert "image/svg+xml" in r.headers["content-type"]
|
||||
|
||||
|
||||
def test_app_shell_references_pwa_assets(client):
|
||||
r = client.get("/app")
|
||||
assert r.status_code == 200
|
||||
body = r.text
|
||||
assert "/manifest.webmanifest" in body
|
||||
assert "serviceWorker" in body
|
||||
assert "connect-card" in body # scan-to-connect card present in settings tab
|
||||
Reference in New Issue
Block a user