Skip to content

Commit

Permalink
Improve test id implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
emir89 committed Feb 3, 2025
1 parent 98a73ae commit 85a1fca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/extensions/codemirror/CodeMirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const CodeEditor = ({
autoFocus = false,
disabled = false,
intent,
...otherCodeEditorProps
}: CodeEditorProps) => {
const parent = useRef<any>(undefined);

Expand Down Expand Up @@ -353,12 +354,13 @@ export const CodeEditor = ({
// overwrite/extend some attributes
id={id ? id : name ? `codemirror-${name}` : undefined}
ref={parent}
data-test-id="codemirror-wrapper"
data-testid={dataTestId ? `${dataTestId}_codemirror}` : undefined}
// @deprecated (v25) fallback with static test id will be removed
data-test-id={dataTestId ? dataTestId : "codemirror-wrapper"}
className={
`${eccgui}-codeeditor ${eccgui}-codeeditor--mode-${mode}` +
(outerDivAttributes?.className ? ` ${outerDivAttributes?.className}` : "")
}
{...otherCodeEditorProps}
/>
);
};
Expand Down

0 comments on commit 85a1fca

Please sign in to comment.