You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
Actually, this is more a question than an issue. We are trying to write tests including the rich text editor that we built using DraftJS. Our rich text editor is part of a bigger form (written with React) that we need to test. One of the problem that we faced is we don't know how to simulate a text input into our editor. Ideally, we would like to use the React TestUtils.Simulate function.
Any advice on how to proceed? Which event to we need to simulate on which DOM node?
Thanks!
The text was updated successfully, but these errors were encountered:
Well, I've finally found the answer to my question debugging Draft.
So here is the solution if anybody needs it. You need to target the dom node with the class name public-DraftEditor-content and trigger a beforeInputevent.
With React TestUtils:
var draftEditorContent = TestUtils.findRenderedDOMComponentWithClass("public-DraftEditor-content");
TestUtils.Simulate.beforeInput(draftEditorContent, {data: "some text"});
Hi all,
First, thanks for providing such a great library.
Actually, this is more a question than an issue. We are trying to write tests including the rich text editor that we built using DraftJS. Our rich text editor is part of a bigger form (written with React) that we need to test. One of the problem that we faced is we don't know how to simulate a text input into our editor. Ideally, we would like to use the React TestUtils.Simulate function.
Any advice on how to proceed? Which event to we need to simulate on which DOM node?
Thanks!
The text was updated successfully, but these errors were encountered: