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

Docgen: split getIntermediateRepresentation unit tests in smaller tests #31468

Merged
merged 10 commits into from May 6, 2021

Conversation

@ciampo
Copy link
Contributor

@ciampo ciampo commented May 4, 2021

Description

The getIntermediateRepresentation unit tests currently have a lot of assertions per test, making them hard to read and debug in case of failure.
This PR aims at splitting the assertion into smaller tests.

The actual code for the tests hasn't been updated. The main changes are:

  • Add one intermediate level of describe around most tests
  • Split long tests into smaller ones

Most of the diff changes are caused by the change in indentation.

How has this been tested?

  • Run npm run test-unit packages/docgen
  • Make sure that all tests are passing
  • Check how the list of tests for getIntermediateRepresentation is more granular

Screenshots

N/A

Types of changes

Refactor

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • (N/A) I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
@github-actions
Copy link

@github-actions github-actions bot commented May 4, 2021

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @ciampo! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Thanks for the contribution @ciampo 👍 !

@ntsekouras ntsekouras merged commit 7944946 into WordPress:trunk May 6, 2021
20 checks passed
20 checks passed
@github-actions
Bump version
Details
@github-actions
Cancel Previous Runs
Details
@github-actions
Check
Details
@github-actions
Checks (12)
Details
@github-actions
Admin - 1 Admin - 1
Details
@github-actions
Run performance tests
Details
@github-actions
pull-request-automation
Details
@github-actions
test (gutenberg-editor-initial-html)
Details
@github-actions
test (12.2, gutenberg-editor-initial-html)
Details
@github-actions
JavaScript (12)
Details
@github-actions
Checks (14)
Details
@github-actions
Admin - 2 Admin - 2
Details
@github-actions
JavaScript (14)
Details
@github-actions
Admin - 3 Admin - 3
Details
@github-actions
Admin - 4 Admin - 4
Details
@github-actions
Build Release Artifact
Details
@github-actions
Create Release Draft and Attach Asset
Details
@github-actions
Mobile
Details
@github-actions github-actions bot added this to the Gutenberg 10.7 milestone May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants