add selector for code editor (#33554)

This commit is contained in:
Erik Sundell 2021-04-30 22:07:34 +02:00 committed by GitHub
parent 759a0cd71b
commit cedac5f4d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -192,4 +192,7 @@ export const Components = {
DataLinksContextMenu: {
singleLink: 'Data link',
},
CodeEditor: {
container: 'Code editor container',
},
};

View File

@ -1,4 +1,6 @@
import React from 'react';
import { selectors } from '@grafana/e2e-selectors';
import { withTheme } from '../../themes';
import { Themeable } from '../../types';
import { Monaco, MonacoEditor as MonacoEditorType, CodeEditorProps, MonacoOptions } from './types';
@ -124,7 +126,7 @@ class UnthemedCodeEditor extends React.PureComponent<Props> {
}
return (
<div onBlur={this.onBlur}>
<div onBlur={this.onBlur} aria-label={selectors.components.CodeEditor.container}>
<MonacoEditor
width={width}
height={height}