- Waiter: Bookings (side drawer, for whoever has connect_orders.manage or reservations.manage, with the online-orders app on): requests made online are confirmed or declined with a reason the guest sees; confirmed ones are seated at a free table (its seats shown, a warning mark when the party is bigger) or cancelled / marked as a no-show; the food ordered ahead and its kitchen time; live updates. - Backend: the bookings routes take reservations.manage too (require_any). - @xenia/ui ReasonPicker + reasonText (gallery, unit test), first piece moved from the terminal (4.6 → 4.8): the counter's online reject and booking decline dialogs use it; the waiter loads @xenia/ui styles.css (the .x-* components; tokens as before). - Tests: waiter e2e +2 (request listed with the key, confirmed and seated from the phone); terminal.mjs and qr_table.mjs green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
477 B
JavaScript
11 lines
477 B
JavaScript
import { test } from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { reasonText } from '../src/components/reasons.js'
|
|
|
|
test('reasonText: the option label, the typed text for other, nothing for no choice', () => {
|
|
const options = [{ value: 'full', label: 'We are full' }]
|
|
assert.equal(reasonText('full', options), 'We are full')
|
|
assert.equal(reasonText('other', options, ' Private party '), 'Private party')
|
|
assert.equal(reasonText(null, options), '')
|
|
})
|