feat(manager): the venue's identity (Settings -> Identity): name, slogan, named colours, logos, guest Wi-Fi, contact details
Set once (GET/PUT /api/identity, venue.name + venue.identity); every colour field offers the venue's colours first (VenueColoursProvider in @xenia/ui); signage screens get the identity and the venue's time zone with their venue and are told on a change; logos are protected in the media library; wifiQr() for the join-the-network code. Plan 6R.14, F-111. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// The identity form (6R.14): what it sends.
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { identityBody, newColour } from '../src/pages/Settings/sections/identityLogic.js'
|
||||
|
||||
test('the identity as it is saved: logos as ids, empty texts as null, names trimmed', () => {
|
||||
const body = identityBody({ name: ' Xenia ', slogan: ' ', colours: [{ name: ' Main ', colour: '#112233' }], logos: { main: { id: 4, card: '/x' } },
|
||||
wifi: { ssid: 'Guests', hidden: 1 }, contact: { phone: ' 123 ', email: '' } })
|
||||
assert.equal(body.name, 'Xenia')
|
||||
assert.equal(body.slogan, null)
|
||||
assert.deepEqual(body.colours, [{ name: 'Main', colour: '#112233' }])
|
||||
assert.deepEqual(body.logos, { main: 4, light: null, dark: null, icon: null })
|
||||
assert.deepEqual(body.wifi, { ssid: 'Guests', password: null, security: 'WPA', hidden: true, note: null })
|
||||
assert.equal(body.contact.phone, '123')
|
||||
assert.equal(body.contact.email, null)
|
||||
assert.equal(newColour(1, 'x').name, 'x')
|
||||
})
|
||||
Reference in New Issue
Block a user