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

Enable Artemis to hook into the React render timeline for more reliable tests #296

Merged
merged 18 commits into from
Sep 2, 2023

Conversation

pal03377
Copy link
Contributor

@pal03377 pal03377 commented Jul 22, 2023

Checklist

  • I documented the TypeScript code using JSDoc style.

Motivation and Context

To fix flaky client tests related to Apollon in #6955, I need to be able to wait for the next render cycle in React. To my knowledge, this is not possible without some "help" from the React code itself (or with a React testing library, which we don't use). Therefore, we need this PR.

Description

Added a new promise to the ApollonEditor called nextRender, which resolves when the next scheduled React render of the editor component happens. It also ensures that ApollonEditor.store will be properly initialized before it resolves.

Steps for Testing

Test Coverage

File Line
apollon-editor.ts 82%
application.tsx 100%

@pal03377
Copy link
Contributor Author

We tested this through ls1intum/Artemis#6955 in a testing session.

@krusche krusche merged commit 88a68f2 into ls1intum:develop Sep 2, 2023
2 checks passed
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.

2 participants