From b09868e9a10b3eed66cf0153df47261933380b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9lemy=20Laurans?= Date: Sun, 6 Oct 2024 19:23:14 +0200 Subject: [PATCH] [Fix] Better handling of submittion without sumUp --- src/index.mts | 2 ++ test/normal.test.mts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.mts b/src/index.mts index 2932a19..7be941f 100644 --- a/src/index.mts +++ b/src/index.mts @@ -401,6 +401,8 @@ export default createPrompt( if (summarized) { printToShell.push(summarized) + } else { + printToShell[printToShell.length - 1] += ` (answered, no preview)` } } diff --git a/test/normal.test.mts b/test/normal.test.mts index c523062..a1228ef 100644 --- a/test/normal.test.mts +++ b/test/normal.test.mts @@ -114,7 +114,7 @@ describe('table-multiple prompt [normal]', () => { await Promise.resolve() expect(getScreen()).toMatchInlineSnapshot([ - '"✔ What do you want?"', + '"✔ What do you want? (answered, no preview)"', ].join('\n')) await expect(answer).resolves.toHaveLength(2) @@ -197,7 +197,7 @@ describe('table-multiple prompt [normal]', () => { await Promise.resolve() expect(getScreen()).toMatchInlineSnapshot([ - '"✔ What do you want?"', + '"✔ What do you want? (answered, no preview)"', ].join('\n')) await expect(answer).resolves.toHaveLength(2)