-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Feature] Component SystemWordPress component systemWordPress component system[Feature] UI ComponentsImpacts or related to the UI component systemImpacts or related to the UI component system[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality
Description
What
Improve unit tests by partially rewriting them. They should not be checking implementation details (like classnames, the presence of certain react components...), but instead, they should test the ToolsPanel
component replicating the way end-users interact with it.
Why
Here's a great explainer
A/C
- There should be no usages of
querySelector
,querySelectorAll
or any similar way of getting an element from the DOM. - Similarly, we should not test the exact DOM structure (e.g. getting parent elements, or checking for the existence of a specific React component). We should instead, for example, find components by role, or accessible text
- Add coverage for behaviour related to unique panelIds to cover the user behaviour of switching between similar blocks that share common ToolsPanels. A concrete example is to cover the bug fix in ToolsPanelItem: Add panelId check before calling toggle methods #35375
Metadata
Metadata
Assignees
Labels
[Feature] Component SystemWordPress component systemWordPress component system[Feature] UI ComponentsImpacts or related to the UI component systemImpacts or related to the UI component system[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] Code QualityIssues or PRs that relate to code qualityIssues or PRs that relate to code quality