bito-code-review[bot] commented on code in PR #39434:
URL: https://github.com/apache/superset/pull/39434#discussion_r4018346280
##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/AdvancedSection.tsx:
##########
@@ -22,6 +22,7 @@ import type { editors } from '@apache-superset/core';
import { EditorHost } from 'src/core/editors';
import { ModalFormField } from 'src/components/Modal';
import { ValidationObject } from 'src/components/Modal/useModalValidation';
+import LabelColorMapping from './LabelColorMapping';
type EditorAnnotation = editors.EditorAnnotation;
Review Comment:
<!-- Bito Reply -->
The assessment is accurate. The current test suite for
`LabelColorMapping.test.tsx` only covers basic rendering and the addition of a
new row, lacking verification for `onJsonMetadataChange` callbacks and missing
coverage for updating or deleting existing mappings. Addressing these gaps is
necessary to ensure the component's functionality is fully validated.
**superset-frontend/src/dashboard/components/PropertiesModal/sections/LabelColorMapping.test.tsx**
```
test('calls onJsonMetadataChange when a mapping is added', () => {
render(<LabelColorMapping {...defaultProps} />);
fireEvent.click(screen.getByText('+ Add more'));
// Add logic to fill inputs and trigger change
expect(defaultProps.onJsonMetadataChange).toHaveBeenCalled();
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]