-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Nav block: link text color inheritance fixes and tests #51710
Conversation
Size Change: +5.56 kB (0%) Total Size: 1.43 MB
ℹ️ View Unchanged
|
Flaky tests detected in c693611. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5534144204
|
c621dda
to
8273dba
Compare
40f0454
to
37757d1
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
I did a quick scan (as I know it's not RfR). My main concern would be the dense blocks of getByRole
followed by .click()
. It's really hard to determine what is happening.
This is going to be a great PR when it's ready.
We might want to consider splitting the Navigation tests into smaller/logical chunks to leverage sharding better. |
Mmmh, I'm not sure if I'm missing something, but I think we already do that? This particular PR groups it's tests on their own, and we've been doing that in other instances. Or do you mean, moving the blocks from the general "Navigation block" section like the interactivity tests are doing? If that's the case, I can make the change for this PR tests and then follow up for the rest on another PR. |
@MaggieCabrera, sorry, I mean splitting tests into separate files. We don't have to do it here, but something to consider as the Navigation block tests grow. |
Yeah, that probably makes sense |
1ace2bd
to
ecb54df
Compare
I'm right there with you. I tried to comment as thoroughly as possible. There's probably some improvements we can make like making the colors into variables like I did for the biggest test (where the RGB codes are repeated multiple times and become less and less readable). Happy to hear any other improvements anyone can suggest. |
…dd/defer-script-loading-strategy * 'trunk' of https://github.com/WordPress/gutenberg: (24 commits) Add filter to turn off Interactivity API for a block (#52579) Search: Remove unnecessary useEffect (#52604) Navigation: Simplify the useSelect for useNavigationMenus (#51977) Item: Unify focus style and add default font styles (#52495) Update Changelog for 16.2.1 Bump plugin version to 16.2.1 Avoid passing undefined `selectedBlockClientId` in `BlockActionsMenu` (#52595) Cover Block: Fix block deprecation when fixed background is enabled (#51612) Nav block: link text color inheritance fixes and tests (#51710) Stabilize defaultBlock, directInsert API's and getDirectInsertBlock selector (#52083) Fix console warning by improving error handling in Nav block classic menu conversion (#52591) Fix: Remove link action of Link UI for draft pages created from Nav block does not correctly remove link. (#52415) Lodash: Remove remaining `_.get()` from block editor and deprecate (#52561) Fix importing classic menus (#52573) ResizableFrame: Make keyboard accessible (#52443) Site Editor: Fix navigation menu sidebar actions order and label (#52592) correct a typo: sapce -> space (#52578) Avoid errors in Dimension visualizers when switching between iframed and non-iframed editors (#52588) Patterns: Add client side pagination to patterns list (#52538) Site Editor: Make sidebar back button go *back* instead of *up* if possible (#52456) ...
What?
Closes #51575
🤖 Generated by Copilot at 27b5873
This pull request refactors the color and layout styles of the navigation block and its items. It fixes a bug with the color inheritance, removes the
__experimentalStyle
property fromblock.json
, and adds tests to cover possible regressions in the future.Why?
The color settings for the navigation block have had multiple regressions over time. Instead of simply solving #51575 I've decided to add test coverage to this feature.
Related PRs:
#41898
#31149
#44578
How?
🤖 Generated by Copilot at 27b5873
__experimentalStyle
property from the navigation block'sblock.json
file to avoid conflicts with the global styles system and the link color feature (link):where
pseudo-class and lower the specificity to allow theme overrides (link)Testing Instructions
Run
npm run test:e2e:playwright -- -g "Navigation colors"
Ideally, the tests passing are all the testing this PR requires, but we might be missing edge cases that are not covered by them, so the best testing this PR can have is check that the tests make sense and try to find gaps that we might be missing.