Skip to content

Fix toHaveStyleRule matching for direct child targets#3380

Open
puneetdixit200 wants to merge 2 commits into
emotion-js:mainfrom
puneetdixit200:fix-jest-nested-style-rule
Open

Fix toHaveStyleRule matching for direct child targets#3380
puneetdixit200 wants to merge 2 commits into
emotion-js:mainfrom
puneetdixit200:fix-jest-nested-style-rule

Conversation

@puneetdixit200

Copy link
Copy Markdown

Summary

  • Normalize selector combinator spacing when matching string target selectors.
  • Add regression coverage for nested direct child style rules with target: '> div'.
  • Add a patch changeset for @emotion/jest.

Fixes #3000

Tests

  • yarn jest packages/jest/test/matchers.test.js -t "nested direct child" --runInBand
  • yarn jest packages/jest/test/matchers.test.js --runInBand
  • yarn jest packages/jest/test --runInBand
  • yarn prettier --check packages/jest/src/utils.js packages/jest/test/matchers.test.js .changeset/witty-apples-rest.md
  • yarn eslint packages/jest/src/utils.js packages/jest/test/matchers.test.js
  • git diff --check

@changeset-bot

changeset-bot Bot commented May 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d3946af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@emotion/jest Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented May 21, 2026

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

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.

Emotion matchers not able to see properties on React object.

1 participant