From e4d9aff4f266df0895b92f928e417174895f1392 Mon Sep 17 00:00:00 2001 From: Ruggero Cino Date: Mon, 11 Dec 2023 11:10:38 +0100 Subject: [PATCH] Update input container tests --- .../input/inputContainer/inputContainer.test.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/input/inputContainer/inputContainer.test.tsx b/src/components/input/inputContainer/inputContainer.test.tsx index 323ce5423..aead15619 100644 --- a/src/components/input/inputContainer/inputContainer.test.tsx +++ b/src/components/input/inputContainer/inputContainer.test.tsx @@ -36,10 +36,11 @@ describe(' component', () => { expect(screen.getByText(helpText)).toBeInTheDocument(); }); - it('renders the info text when defined', () => { - const infoText = '10/1000'; - render(createTestComponent({ infoText })); - expect(screen.getByText(infoText)).toBeInTheDocument(); + it('renders the input value counter when maxLength is defined', () => { + const maxLength = 100; + const inputLength = 47; + render(createTestComponent({ maxLength, inputLength })); + expect(screen.getByText(`[${inputLength}/${maxLength}]`)).toBeInTheDocument(); }); it('renders the input alert when defined', () => {