From cbcc6d56a696d88280a5b8c4b2a591538d5b5041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9lemy=20Laurans?= Date: Fri, 19 Apr 2024 00:51:36 +0200 Subject: [PATCH] [TEST] Asynchronous validation lock input --- test/normal.test.mts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/normal.test.mts b/test/normal.test.mts index edd35f2..ed06e1c 100644 --- a/test/normal.test.mts +++ b/test/normal.test.mts @@ -215,6 +215,20 @@ describe('table-multiple prompt [normal]', () => { '└──────────┴───────┴───────┘"' ].join('\n')) + events.keypress('down') + + expect(getScreen()).toMatchInlineSnapshot([ + '"⠋ What do you want?', + '', + '┌──────────┬───────┬───────┐', + '│ 1-2 of 2 │ A? │ B? │', + '├──────────┼───────┼───────┤', + '│ Test 1 │ [ ◉ ] │ ◯ │', + '├──────────┼───────┼───────┤', + '│ Test 2 │ ◯ │ ◯ │', + '└──────────┴───────┴───────┘"' + ].join('\n')) + await new Promise(resolve => { setTimeout(() => resolve(), 400) })