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

test: add frontend board redux test #105

Conversation

rayatn1011
Copy link
Contributor

No description provided.

@rayatn1011 rayatn1011 self-assigned this Jul 8, 2023
@kayac-chang
Copy link
Collaborator

kayac-chang commented Jul 9, 2023

Because the Board update will be batched to the next frame update.
see
So we have to wait until after the next frame is updated.

Please add the nextFrame function into ~/test/utils/index.tsx.

export function nextFrame() {
  return new Promise((resolve) => {
    requestAnimationFrame(resolve);
  });
}

And add the nextFrame function in the act callback.

    await act(async () => {
      store.dispatch(/* something will update board */);
      
      // wait next frame
      await nextFrame();
    });

@kayac-chang
Copy link
Collaborator

fixed by #107, closed.

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

Successfully merging this pull request may close these issues.

None yet

2 participants