Skip to content

Tests: Add coverage for text clip resets on feature selectors - #1

Open
abhishekfdd wants to merge 1 commit into
aaronrobertshaw:backport/86246-text-clip-feature-selectorsfrom
abhishekfdd:test/66465-extra-tests
Open

abhishekfdd wants to merge 1 commit into
aaronrobertshaw:backport/86246-text-clip-feature-selectorsfrom
abhishekfdd:test/66465-extra-tests

Conversation

@abhishekfdd

Copy link
Copy Markdown

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: :hover and @mobile + :hover colors 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 :hover color on the same block. Synthetic, as above.
  • test_66465_variation_mobile_text_color_resets_fill_on_feature_selector: block style @mobile color 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 a color feature selector but no background one. 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: object color selector (core/tab-list), so the reset goes on the text subfeature 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 @mobile color on core/search.

Run on this branch (base 104422e, the head of WordPress#15432):

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.

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.
@github-actions

Copy link
Copy Markdown

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:

Props abhishekfdd.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant