-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Navigator: add more pattern matching tests, refine existing tests #47910
Conversation
@@ -98,25 +105,6 @@ function CustomNavigatorButton( { | |||
); | |||
} | |||
|
|||
function CustomNavigatorButtonWithFocusRestoration( { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in favour of using CustomNavigatorButton
everywhere, since today there are basically no differences between the two
@@ -396,8 +428,6 @@ describe( 'Navigator', () => { | |||
} ); | |||
|
|||
it( 'should escape the value of the `path` prop', async () => { | |||
const user = userEvent.setup(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved part of this test to a new test (should restore focus correctly even when the
path needs to be escaped
). Reviewing commit-by-commit should make this part easier to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great additions. This is going to give us much needed confidence with the goToParent work.
Flaky tests detected in dae7b0a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4137292770
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @ciampo 👍 It's a delight to be reading your test code 🥇
447e3cd
to
2f3c758
Compare
2f3c758
to
dae7b0a
Compare
…7910) * Add one extra button to improve quality of focus restoration tests * Fix typo * Add screens with pattern matching to test component * Add named arguments tests * Refine invalid HTML attribute tests, split focus restoration part to new test * Remove reduntant component * CHANGELOG
Cherry-picked this PR to the wp/6.2 branch. |
What?
Following up the work in #47827, this PR adds more unit test to the suite of
Navigator
components (and refines some existing ones).Why?
More tests, more confidence when making changes (especially in preparation for #47883)
How?
patternMatch
unit tests)Testing Instructions
No runtime changes.
Make sure that unit test changes look good, and that tests pass.