rebenitez1802 commented on code in PR #35349:
URL: https://github.com/apache/superset/pull/35349#discussion_r2433214229
##########
superset-frontend/src/features/themes/ThemeModal.test.tsx:
##########
@@ -78,6 +78,24 @@ afterEach(() => {
jest.clearAllMocks();
});
+// Helper to add valid JSON data to the theme
+// Uses direct DOM manipulation of the Ace editor since it's not easily
testable otherwise
+const addValidJsonData = () => {
+ const validJson = JSON.stringify(
+ { token: { colorPrimary: '#1890ff' } },
+ null,
+ 2,
+ );
+ // The JsonEditor renders an Ace editor which creates a .ace_editor element
+ const aceEditorElement = document.querySelector('.ace_editor');
+ if (aceEditorElement) {
+ const aceEditor = (aceEditorElement as any).env?.editor;
+ if (aceEditor) {
+ aceEditor.setValue(validJson, -1);
+ }
+ }
+};
+
Review Comment:
just refactored this.
--
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]