mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 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:
3
types/react-draft-wysiwyg/index.d.ts
vendored
3
types/react-draft-wysiwyg/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
11
types/react-draft-wysiwyg/test/render-with-test-id.tsx
Normal file
11
types/react-draft-wysiwyg/test/render-with-test-id.tsx
Normal 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'));
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user