From 9f8e5d4004b8b71ce1af5e883b527e7213fcbd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pet=C5=99=C3=ADk?= Date: Thu, 29 Sep 2022 10:57:13 +0200 Subject: [PATCH 1/5] Text area test revamp --- .../TextArea/__tests__/TextArea.test.tsx | 223 +++++++++--------- .../__snapshots__/TextArea.test.tsx.snap | 125 +--------- 2 files changed, 116 insertions(+), 232 deletions(-) diff --git a/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx b/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx index b8d4e2fe54c..8b81207a583 100644 --- a/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx +++ b/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx @@ -11,116 +11,115 @@ const props = { value: 'test textarea' }; -describe('TextArea', () => { - test('textarea passes value and event to onChange handler', async () => { - const user = userEvent.setup(); - - render(); - - await user.type(screen.getByLabelText('test textarea'), 'a'); - expect(props.onChange).toHaveBeenCalledWith('a', expect.any(Object)); - }); - - test('simple text area', () => { - const { asFragment } = render( - -`; - -exports[`TextArea disabled text area using isDisabled 1`] = ` - - - -`; - -exports[`TextArea horizontally resizable text area 1`] = ` - - - -`; - -exports[`TextArea read only text area using default readOnlyVariant 1`] = ` - - - -`; - -exports[`TextArea read only text area using isReadOnly 1`] = ` - - - -`; - -exports[`TextArea read only text area using plain readOnlyVariant 1`] = ` - - - -`; - -exports[`TextArea read only text area using readOnly 1`] = ` - - - -`; - -exports[`TextArea simple text area 1`] = ` - - - -`; - -exports[`TextArea validated text area error 1`] = ` - - - -`; - -exports[`TextArea vertically resizable text area 1`] = ` - - + style="--pf-c-form-control--textarea--Height: 6px;" + /> `; From 56d1877ece359e81a0fc416c5c305c1a387f3657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pet=C5=99=C3=ADk?= Date: Tue, 4 Oct 2022 16:37:38 +0200 Subject: [PATCH 2/5] Edit ref test --- .../components/TextArea/__tests__/TextArea.test.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx b/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx index 8b81207a583..b86ce057073 100644 --- a/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx +++ b/packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx @@ -57,8 +57,8 @@ test('Renders disabled text area using disabled', () => { expect(screen.getByRole('textbox')).toBeDisabled(); }); -test('Renders read only text area using isReadOnly', () => { - render(