Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vashjs committed Dec 16, 2024
1 parent 34bfb98 commit 84e046b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Loading size="large" />;

return (
Expand All @@ -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}
Expand Down

0 comments on commit 84e046b

Please sign in to comment.