🤖 Merge PR #50250 [@types/react-draft-wysiwyg]: add missing webDriverTestId prop type by @ardmcs

* react-draft-wysiwyg: add webDriverTestId prop type

* react-draft-wysiwyg: add tests for webDriverTestID
This commit is contained in:
Zachary Zhou
2021-01-04 19:22:17 +08:00
committed by GitHub
parent 91c412dbc2
commit 283ce8c84c
3 changed files with 15 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ export class ContentBlock extends Draft.ContentBlock {}
export class SelectionState extends Draft.SelectionState {}
export interface EditorProps {
webDriverTestID?: string;
onChange?(contentState: RawDraftContentState): void;
onEditorStateChange?(editorState: EditorState): void;
onContentStateChange?(contentState: RawDraftContentState): void;
@@ -68,7 +69,7 @@ export interface EditorProps {
text: string,
html: string,
editorState: EditorState,
onChange: (editorState: EditorState) => void
onChange: (editorState: EditorState) => void,
): boolean;
customStyleMap?: object;
}

View File

@@ -0,0 +1,11 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Editor } from 'react-draft-wysiwyg';
const RenderWithTestId = () => (
<div>
<Editor webDriverTestID="test" />
</div>
);
ReactDOM.render(<RenderWithTestId />, document.getElementById('target'));

View File

@@ -26,6 +26,7 @@
"test/custom-toolbar-tests.tsx",
"test/focus-blur-callbacks-tests.tsx",
"test/uncontrolled-raw-draft-content-state.tsx",
"test/custom-style-map-tests.tsx"
"test/custom-style-map-tests.tsx",
"test/render-with-test-id.tsx"
]
}