Skip to content

Conversation

@hussam-i-am
Copy link
Contributor

@hussam-i-am hussam-i-am commented Nov 20, 2024

Fixes the failing integration test related to ref forwarding in Popover:

Error:Error: Expected test not to call console.error().

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `ValidationErrorPopover`.
    at className (/workspace/github/node_modules/@primer/react/lib/Popover/Popover.js:34:3)
    at id (/workspace/github/ui/packages/validation-error-popover/ValidationErrorPopover.tsx:65:3)
    at div
[...truncated...]

Changelog

New

Changed

  • Wraps Popover in a forwardRef function

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@hussam-i-am hussam-i-am self-assigned this Nov 20, 2024
@hussam-i-am hussam-i-am requested a review from a team as a code owner November 20, 2024 19:23
@hussam-i-am hussam-i-am requested a review from jonrohan November 20, 2024 19:23
@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2024

🦋 Changeset detected

Latest commit: a78d483

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Nov 20, 2024
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 100.55 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js 101.01 KB (-0.06% 🔽)

Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hussam-i-am hussam-i-am added this pull request to the merge queue Nov 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@hussam-i-am hussam-i-am added this pull request to the merge queue Nov 20, 2024
Merged via the queue into main with commit e9e4d1c Nov 20, 2024
43 checks passed
@hussam-i-am hussam-i-am deleted the hussam-i-am/fix-popover-ref branch November 20, 2024 20:36
@primer primer bot mentioned this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants