ckeditor / ckeditor5-react

Official CKEditor 5 React component.
https://ckeditor.com/ckeditor-5
Other
420 stars 100 forks source link

Flaky 'useMultiRootEditor' slow editor test #542

Open f1ames opened 2 days ago

f1ames commented 2 days ago

The should assign properly data property to editor even if it is still mounting (see here) test fails randomly with:

- Expected
+ Received

  Object {
    "content": "",
-   "intro": "Hello World!",
+   "intro": "",
  }

 ❯ tests/useMultiRootEditor.test.tsx:951:57
    949|     await waitFor( () => {
    950|      expect( result.current.editor ).to.be.instanceof( SlowEditor );
    951|      expect( result.current.editor!.data.get() ).to.deep.equal( {
       |                                                         ^
    952|       intro: 'Hello World!',
    953|       content: ''

See on CI.

https://github.com/ckeditor/ckeditor5-react/blob/8886ca37769cd5145e6c6249ea5859a60ee9120b/tests/useMultiRootEditor.test.tsx#L903

It might be related to using timeouts:

https://github.com/ckeditor/ckeditor5-react/blob/8886ca37769cd5145e6c6249ea5859a60ee9120b/tests/useMultiRootEditor.test.tsx#L938-L955

What's worth mentioning is that it seems it got more unstable after #534 PR got merged.