Skip to content

Commit

Permalink
Fix test to match with new undefined handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartheleway committed Apr 10, 2024
1 parent 25c159f commit 6b19312
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions test/multiple.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ describe('table-multiple prompt [multiple]', () => {
])
})

it('cannot select undefined choice when other choice selected', async () => {
it('can select undefined choice when other choice selected', async () => {
const choices = [
{
value: '1',
Expand Down Expand Up @@ -474,20 +474,15 @@ describe('table-multiple prompt [multiple]', () => {
'┌──────────┬───────┬───────┬───────────┐',
'│ 1-2 of 2 │ A? │ B? │ Untouched │',
'├──────────┼───────┼───────┼───────────┤',
'│ Test 1 │ │ ☐ │ [ ] │',
'│ Test 1 │ │ ☐ │ [ ] │',
'├──────────┼───────┼───────┼───────────┤',
'│ Test 2 │ ☐ │ ☐ │ ☒ │',
'└──────────┴───────┴───────┴───────────┘"'
].join('\n'))

events.keypress('enter')

await expect(answer).resolves.toEqual([
{
choice: choices[0],
answers: ['A'],
}
])
await expect(answer).resolves.toEqual([])
})

it('goes back to undefined choice when no other choice selected', async () => {
Expand Down

0 comments on commit 6b19312

Please sign in to comment.