Repository navigation
Tests: Add coverage for text clip resets on feature selectors - #1
Open
abhishekfdd wants to merge 1 commit into
Conversation
Adds tests for the text clip resets on block feature selectors: - `:hover` and `@mobile` + `:hover` colors on a comma-separated feature selector, and a block style `:hover` color (test-only selectors). - A block style `@mobile` color on core/search. - A block style main rule color over the block's text gradient. - A front-end block style with its own text gradient and a `@mobile` color. - The `text` subfeature selector of an object `color` selector (core/tab-list). - The clip escape falling back to the root selector without a `background` feature selector. - Unchanged output for blocks without feature selectors, and no reset without a text clip. See #66465.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 9 tests on top of WordPress#15432. 7 fail on trunk and pass with the fix. The other 2 are controls that expect no change.
Trac ticket: https://core.trac.wordpress.org/ticket/66465
Testing notes and the combined test with WordPress#15366: WordPress#15432 (comment)
Tests
In
tests/phpunit/tests/theme/wpThemeJson.php:test_66465_hover_text_color_resets_fill_on_comma_separated_feature_selector::hoverand@mobile+:hovercolors on a comma-separated feature selector. Synthetic: uses test-only feature selectors on core/button, since no core block with pseudo states has feature selectors.test_66465_variation_hover_text_color_resets_fill_on_feature_selector: block style:hovercolor on the same block. Synthetic, as above.test_66465_variation_mobile_text_color_resets_fill_on_feature_selector: block style@mobilecolor on core/search.test_66465_variation_main_rule_text_color_over_block_text_gradient_resets_fill: block style main rule color over the block's text gradient (core/group, no feature selectors).test_66465_clip_escape_falls_back_to_root_without_background_feature_selector: a test block with acolorfeature selector but nobackgroundone. The clip escape stays on the root selector, and a color-only state gets the reset on the color selector.test_66465_fill_reset_uses_text_subfeature_selector: objectcolorselector (core/tab-list), so the reset goes on thetextsubfeature selector.test_66465_blocks_without_feature_selectors_are_unchanged(control): full stylesheet for core/group and core/button, byte-identical to trunk.test_66465_text_color_without_text_gradient_gets_no_reset(control): no reset with a gradient but no text clip, or with no gradient at all.In
tests/phpunit/tests/block-supports/block-style-variations.php:test_66465_rendered_variation_breakpoint_text_color_over_own_text_gradient_resets_fill: front-end (per-instance) block style with its own text gradient and a@mobilecolor on core/search.Run on this branch (base 104422e, the head of WordPress#15432):
npm run test:php -- --group 66465: OK (12 tests: Global Styles: Put text clip escapes on a block's feature selectors WordPress/wordpress-develop#15432's 3 plus these 9).npm run test:php -- --group themes,block-supports: OK (1312 tests, 0 failures, 16 skipped).Feel free to cherry-pick these into WordPress#15432 instead of merging this PR.
Use of AI
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Writing the tests and the description; I reviewed and edited them.