Show progress during initial admin and seat-control submissions; retain exact recovery instructions for uncertain requests and explicit retries. Keep seat recovery and handover confirmations above the table until Continue without blocking gameplay. Use readable 16px text and 44px controls. Verified isolated checkpoint: types, lint, 5381 offline tests, 52 HTTP tests and build. Local delayed/lost-response browser QA covered admin creation, durable retry, handover and seat recovery, mobile readability and saved-seat restoration. Existing 2098 rooms and 4455 seats preserved. Deployment acceptance follows separately.
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { Children, isValidElement } from 'react';
|
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
import { SeatConfirmation } from '../components/seat-confirmation';
|
|
import { Button } from '../components/ui/button';
|
|
|
|
for (const kind of ['recovery', 'handover'] as const) {
|
|
void test(`${kind} confirmation explains revoked access and only acknowledges on Continue`, () => {
|
|
let acknowledged = 0;
|
|
const notice = SeatConfirmation({ kind, onContinue: () => { acknowledged++; } });
|
|
const markup = renderToStaticMarkup(notice);
|
|
assert.match(markup, /<output/);
|
|
assert.match(markup, /revoked/);
|
|
assert.match(markup, /font-size:1rem/);
|
|
assert.match(markup, /<button[^>]*type="button"[^>]*>Continue<\/button>/);
|
|
assert.doesNotMatch(markup, /autofocus|aria-modal/);
|
|
if (kind === 'handover') assert.match(markup, /Protect your saved seat/);
|
|
assert.equal(acknowledged, 0);
|
|
const button = Children.toArray(notice.props.children).filter(isValidElement).find(child => child.type === Button);
|
|
assert.ok(button);
|
|
(button.props as { onClick: () => void }).onClick();
|
|
assert.equal(acknowledged, 1);
|
|
});
|
|
}
|