Duplicated screen mode: /present shows the projector view with the admin in a drawer (Gérer); both modes offered on the links page and the share tab

This commit is contained in:
2026-11-17 20:41:02 +01:00
parent cc1c46da6b
commit 450d923e78
9 changed files with 83 additions and 3 deletions
+17
View File
@@ -734,3 +734,20 @@ def test_hand_added_votes(server):
await a.aclose()
asyncio.run(run())
def test_duplicated_screen_page(server):
p = create(server)
admin(server, p, "PATCH", "", json={"enrollment_open": True})
r = httpx.get(f"{server['base']}/present/{p['id']}", verify=server["verify"])
assert r.status_code == 200
# the admin page may only be framed by the site itself (duplicated screen drawer)
assert r.headers["x-frame-options"] == "SAMEORIGIN" and "frame-ancestors 'self'" in r.headers["content-security-policy"]
assert httpx.get(f"{server['base']}/present/nopenope", verify=server["verify"]).status_code == 404
async def run():
# the duplicated screen talks to the projector socket with the admin key
async with projector(server, p, key=p["admin_key"]) as next_token:
assert (await next_token()) is not None
asyncio.run(run())