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

INT-3297: Refactor tests to use BDD style #516

Merged
merged 11 commits into from
Apr 24, 2024
Merged

Conversation

danoaky-tiny
Copy link
Contributor

@danoaky-tiny danoaky-tiny commented Apr 10, 2024

Jira: INT-3297

Changes:

  • Replaced all agar chain usage with newer BDD style of testing or just async await in general.
  • Loader.tsx now exports a render function that returns a ReactEditorContext. This implements Disposable, which simplifies creating safe tests that cleanup editor instances and associated React DOM nodes.
  • Loader.tsx also exports a withVersion function that passes a RenderWithVersion function to a callback. This function is similar to the exported render function but with some props omited:
Omit<IAllProps, 'cloudChannel' | 'tinymceScriptSrc'>
  • Added an eslint override for the tests to support the using keyword.

@danoaky-tiny danoaky-tiny requested a review from a team as a code owner April 10, 2024 04:28
@danoaky-tiny danoaky-tiny requested review from spocke, vpyshnenko, shanmen-tiny, TheSpyder and lorenzo-pomili and removed request for a team April 10, 2024 04:28
@danoaky-tiny danoaky-tiny marked this pull request as draft April 10, 2024 04:48
@danoaky-tiny danoaky-tiny marked this pull request as ready for review April 10, 2024 05:28
@danoaky-tiny danoaky-tiny requested a review from jscasca April 11, 2024 01:48
src/test/ts/alien/Loader.tsx Outdated Show resolved Hide resolved
src/test/ts/alien/Loader.tsx Show resolved Hide resolved
src/test/ts/alien/Loader.tsx Outdated Show resolved Hide resolved
src/test/ts/alien/Loader.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@tiny-james tiny-james left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I like the disposable based cleanup. Make sure you fix that absolute import.

…inyMCE

Also removed `deleteTinyMCE` from Loader.tsx and moved it to
LoadTinyTest.ts
@danoaky-tiny danoaky-tiny requested a review from spocke April 18, 2024 22:32
@danoaky-tiny danoaky-tiny merged commit 1cd38cf into main Apr 24, 2024
5 checks passed
@danoaky-tiny danoaky-tiny deleted the feature/INT-3297 branch April 24, 2024 00:51
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.

6 participants