jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.38k stars 1.15k forks source link

How to add text in editor using react testing library #1334

Closed Shyam268 closed 1 year ago

Shyam268 commented 1 year ago

i have to add the text in editor and tried following example

const textarea = screen.getByRole('textbox');
const event = createEvent.paste(textarea, {
  clipboardData: {
    types: ['text/plain'],
    getData: () => 'MyText',
  },
});
fireEvent(textarea, event);

but no luck.

please help me how to change the text in the editor?

Shyam268 commented 1 year ago

works fine