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), '') })