Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky 'useMultiRootEditor' slow editor test #542

Open
f1ames opened this issue Oct 2, 2024 · 0 comments
Open

Flaky 'useMultiRootEditor' slow editor test #542

f1ames opened this issue Oct 2, 2024 · 0 comments

Comments

@f1ames
Copy link
Contributor

f1ames commented Oct 2, 2024

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.

it( 'should assign properly `data` property to editor even if it is still mounting', async () => {

It might be related to using timeouts:

await timeout( 100 );
result.current.setData( {
intro: 'Hello World!',
content: ''
} );
await timeout( 200 );
deferInitialization.resolve();
await waitFor( () => {
expect( result.current.editor ).to.be.instanceof( SlowEditor );
expect( result.current.editor!.data.get() ).to.deep.equal( {
intro: 'Hello World!',
content: ''
} );
} );

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant