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

Composite: add legacy unit tests to stable version #65952

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Oct 8, 2024

What?

Follow-up to #65720 (comment)

This PR adds the same suite of unit tests that currently runs against the legacy version of Composite to the stable version too.

Why?

Testing gives us confidence and helps us prevent regressions.

How?

  • Copied the suite of unit tests applied to legacy Composite
  • Made a few tweaks:
    • Removed most abstractions in favour of test readability;
    • Changes item selectors from getByText to getByRole
    • adapted the tests to the stable Composite component's APIs

Testing Instructions

  • Code review
  • Make sure unit tests are passing

No runtime changes

@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Package] Components /packages/components labels Oct 8, 2024
@ciampo ciampo requested a review from a team October 8, 2024 16:08
@ciampo ciampo self-assigned this Oct 8, 2024
@ciampo ciampo requested a review from ajitbohra as a code owner October 8, 2024 16:08
Copy link

github-actions bot commented Oct 8, 2024

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: [Type] Enhancement, [Type] Automated Testing, [Package] Components.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

Copy link

github-actions bot commented Oct 8, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo removed the [Type] Enhancement A suggestion for improvement. label Oct 8, 2024
Copy link
Member

@mirka mirka 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 👍

packages/components/src/composite/test/index.tsx Outdated Show resolved Hide resolved
@ciampo ciampo force-pushed the test/composite-add-unit-tests branch from 1710d40 to 72bc7d6 Compare October 8, 2024 22:42
@ciampo ciampo enabled auto-merge (squash) October 8, 2024 22:43
@ciampo ciampo merged commit 5529e44 into trunk Oct 8, 2024
62 of 64 checks passed
@ciampo ciampo deleted the test/composite-add-unit-tests branch October 8, 2024 23:19
@github-actions github-actions bot added this to the Gutenberg 19.5 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants