fix(user-interaction): preserve multi-select custom answers

This commit is contained in:
Yichen Jiang
2026-07-30 00:21:47 +08:00
parent 59ecfac776
commit a777000512
31 changed files with 269 additions and 48 deletions

View File

@@ -4436,8 +4436,12 @@ describe('TUI user-interaction dialogs', () => {
result.terminal.send(' ')
result.terminal.send('\x1b[B')
result.terminal.send(' ')
result.terminal.send('\t')
result.terminal.send('Tests')
result.terminal.send('\r')
await expect(multi).resolves.toEqual({ answers: [{ id: 'targets', selected: ['Code', 'Docs'] }] })
await expect(multi).resolves.toEqual({
answers: [{ id: 'targets', selected: ['Code', 'Docs'], custom: 'Tests' }],
})
const custom = result.ctx.userInteraction.ask({
questions: [{ id: 'other', question: 'Choose or type', options: [{ label: 'Default' }] }],