From e217f5a20e45f6c3c91877b4e6a25bb9e941e224 Mon Sep 17 00:00:00 2001 From: lassopicasso Date: Fri, 13 Dec 2024 13:58:44 +0100 Subject: [PATCH] small adjustment --- .../EditSubformTableColumns.test.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/frontend/packages/ux-editor/src/components/Properties/EditSubformTableColumns/EditSubformTableColumns.test.tsx b/frontend/packages/ux-editor/src/components/Properties/EditSubformTableColumns/EditSubformTableColumns.test.tsx index 93becef0082..c911a56674b 100644 --- a/frontend/packages/ux-editor/src/components/Properties/EditSubformTableColumns/EditSubformTableColumns.test.tsx +++ b/frontend/packages/ux-editor/src/components/Properties/EditSubformTableColumns/EditSubformTableColumns.test.tsx @@ -83,11 +83,8 @@ describe('EditSubformTableColumns', () => { }); await user.click(editButton); - const componentSelect = screen.getByRole('combobox', { - name: textMock('ux_editor.properties_panel.subform_table_columns.choose_component'), - }); - - await user.click(componentSelect); + const componentSelector = getComponentSelector(); + await user.click(componentSelector); await user.click( screen.getByRole('option', { name: new RegExp(`${subformLayoutMock.component1Id}`) }), ); @@ -161,7 +158,8 @@ describe('EditSubformTableColumns', () => { }; rerender(); - expect(screen.getByRole('combobox')).toBeInTheDocument(); + const componentSelector = getComponentSelector(); + expect(componentSelector).toBeInTheDocument(); }); }); @@ -177,6 +175,11 @@ const getAddColumnButton = () => screen.getByRole('button', { name: textMock('ux_editor.properties_panel.subform_table_columns.add_column'), }); +const getComponentSelector = () => + screen.getByRole('combobox', { + name: textMock('ux_editor.properties_panel.subform_table_columns.choose_component'), + }); + const getUpdatedTableColumns = (mockFn: jest.Mock) => mockFn.mock.calls[0][0].tableColumns; const renderEditSubformTableColumns = (