From 84e046b5fff2af470e88fe95fbf8b674ce497db7 Mon Sep 17 00:00:00 2001 From: vashjs Date: Mon, 16 Dec 2024 13:55:14 +0100 Subject: [PATCH] fix comments --- .../ContentUpdatesForm/ValuesColumn.test.js | 6 +----- .../controls/InstanceStatisticalCodesControl.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.test.js b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.test.js index d47cdd16..a5dc00cc 100644 --- a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.test.js +++ b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/ValuesColumn.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { render, fireEvent, waitFor, cleanup } from '@testing-library/react'; +import { render, fireEvent, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom/extend-expect'; import '../../../../../../test/jest/__mock__/reactIntl.mock'; import { IntlProvider } from 'react-intl'; @@ -69,10 +69,6 @@ describe('ValuesColumn Component', () => { }); }); - afterEach(() => { - cleanup(); - }); - it('should render TextField when action type is INPUT', async () => { const { getByRole } = renderComponent(() => CONTROL_TYPES.INPUT); const element = getByRole('textbox'); diff --git a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/controls/InstanceStatisticalCodesControl.js b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/controls/InstanceStatisticalCodesControl.js index 1810aebb..954e20f5 100644 --- a/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/controls/InstanceStatisticalCodesControl.js +++ b/src/components/BulkEditPane/BulkEditListResult/BulkEditInApp/ContentUpdatesForm/controls/InstanceStatisticalCodesControl.js @@ -16,6 +16,14 @@ export const InstanceStatisticalCodesControl = ({ actionName, actionValue, actio const sortedStatisticalCodes = sortWithoutPlaceholder(statisticalCodes); const title = getLabelByValue(sortedStatisticalCodes, actionValue); + const handleChange = value => { + onChange({ + actionIndex, + value, + fieldName: FIELD_VALUE_KEY, + }); + }; + if (isStatisticalCodesLoading) return ; return ( @@ -24,13 +32,7 @@ export const InstanceStatisticalCodesControl = ({ actionName, actionValue, actio key={actionName} id="statisticalCodes" value={actionValue} - onChange={value => { - onChange({ - actionIndex, - value, - fieldName: FIELD_VALUE_KEY, - }); - }} + onChange={handleChange} placeholder={formatMessage({ id: 'ui-bulk-edit.layer.statisticalCode' })} aria-label={formatMessage({ id: 'ui-bulk-edit.ariaLabel.statisticalCode' })} dataOptions={statisticalCodes}