fix: Editeur Excalidraw - diagramme vide (CSS + appState) et auto-save pendant l'edition (BUG-064, BUG-065)
This commit is contained in:
@@ -317,3 +317,25 @@ class TestTokenInvalidation:
|
||||
"/api/auth/me", headers={"Authorization": f"Bearer {token}"}
|
||||
)
|
||||
assert me.status_code == 401
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════
|
||||
# BUG-064 — Excalidraw editor stylesheet (esm.sh) must pass CSP
|
||||
# ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
class TestCspExcalidrawStylesheet:
|
||||
def test_style_src_allows_esm_sh(self, client):
|
||||
"""The Excalidraw editor loads its stylesheet from esm.sh.
|
||||
|
||||
Without this directive the CSS is blocked, the editor is unstyled and
|
||||
its container enters a resize feedback loop up to the 2^25 canvas cap,
|
||||
leaving the scene blank (BUG-064).
|
||||
"""
|
||||
resp = client.get("/api/health")
|
||||
csp = resp.headers.get("content-security-policy", "")
|
||||
style_src = next(
|
||||
(d.strip() for d in csp.split(";") if d.strip().startswith("style-src")),
|
||||
"",
|
||||
)
|
||||
assert style_src, "CSP style-src directive not found"
|
||||
assert "https://esm.sh" in style_src
|
||||
|
||||
Reference in New Issue
Block a user