Files
bonaminandClaude Opus 5.5 1b111c0e27 feat: the venue's identity in every app: its colour as the accent of the waiters' phones and every terminal screen, customer display looks on the identity, the signage logo widget falls back to the venue's logo
Settings -> Venue -> accent "The venue's identity" (venue.theme = identity): bootstrap
carries the identity's first colour and logos; @xenia/ui applyVenueTheme makes the
accent tokens (light and dark, readable foregrounds) from it. A display look's
"Colours and logo" can be the venue's identity. Plan 6R.20, F-117.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:30:14 +02:00

21 lines
1.4 KiB
Python

"""The venue's colour for the staff apps (plan step 4.6): setting venue.theme, in bootstrap."""
def test_venue_theme_reaches_bootstrap(client, make_user, login):
owner = login(make_user(role="owner"))
assert client.get("/api/platform/bootstrap").json()["venue"]["theme"] == "amber" # the waiter's colour so far
assert client.put("/api/settings/venue.theme", headers=owner, json={"value": "blue"}).status_code == 200
assert client.get("/api/platform/bootstrap").json()["venue"]["theme"] == "blue"
r = client.put("/api/settings/venue.theme", headers=owner, json={"value": "neon"})
assert r.status_code in (400, 422)
def test_the_identity_as_the_staff_apps_colour(client, make_user, login):
"""6R.20: venue.theme "identity" = the first colour of the venue's identity; bootstrap carries it and the logos."""
owner = login(make_user(role="owner"))
assert client.get("/api/platform/bootstrap").json()["venue"]["identity"]["colour"] is None
client.put("/api/identity", headers=owner, json={"colours": [{"name": "Main", "colour": "#1E3A8A"}], "slogan": "Since 1987"})
assert client.put("/api/settings/venue.theme", headers=owner, json={"value": "identity"}).status_code == 200
v = client.get("/api/platform/bootstrap").json()["venue"]
assert v["theme"] == "identity" and v["identity"]["colour"] == "#1e3a8a" and v["identity"]["slogan"] == "Since 1987" and v["identity"]["logo"] is None