diff --git a/packages/checkbox/checkbox.test.mts b/packages/checkbox/checkbox.test.mts index 528a84bfa..43cbf337d 100644 --- a/packages/checkbox/checkbox.test.mts +++ b/packages/checkbox/checkbox.test.mts @@ -400,7 +400,55 @@ describe('checkbox prompt', () => { await expect(answer).resolves.not.toContain(unselect); }); - it('allow disabling help tip', async () => {}); + it('allow disabling help tip', async () => { + const { answer, events, getScreen } = await render(checkbox, { + message: 'Select a number', + choices: numberedChoices, + instructions: false, + }); + + expect(getScreen()).toMatchInlineSnapshot(` + "? Select a number + ❯◯ 1 + ◯ 2 + ◯ 3 + ◯ 4 + ◯ 5 + ◯ 6 + ◯ 7 + (Move up and down to reveal more choices)" + `); + + events.keypress('enter'); + expect(getScreen()).toMatchInlineSnapshot('"? Select a number"'); + + await expect(answer).resolves.toEqual([]); + }); - it('allow customizing help tip', async () => {}); + it('allow customizing help tip', async () => { + const { answer, events, getScreen } = await render(checkbox, { + message: 'Select a number', + choices: numberedChoices, + instructions: + ' (Pulse para seleccionar, para alternar todos, para invertir selección, y para continuar)', + }); + + expect(getScreen()).toMatchInlineSnapshot(` + "? Select a number (Pulse para seleccionar, para alternar todos, + para invertir selección, y para continuar) + ❯◯ 1 + ◯ 2 + ◯ 3 + ◯ 4 + ◯ 5 + ◯ 6 + ◯ 7 + (Move up and down to reveal more choices)" + `); + + events.keypress('enter'); + expect(getScreen()).toMatchInlineSnapshot('"? Select a number"'); + + await expect(answer).resolves.toEqual([]); + }); });