Skip to content

chore: update eslint-plugin-jest-dom#1046

Merged
apvale merged 1 commit intomainfrom
fix-warnings-on-tests
Oct 18, 2023
Merged

chore: update eslint-plugin-jest-dom#1046
apvale merged 1 commit intomainfrom
fix-warnings-on-tests

Conversation

@apvale
Copy link
Contributor

@apvale apvale commented Oct 18, 2023

Description of the change

While working on Pluto and running tests, I saw that we have lots of warnings like this:

console.error
    Warning: An update to Radio inside a test was not wrapped in act(...).
    
    When testing, code that causes React state updates should be wrapped into act(...):
    
    act(() => {
      /* fire events that update state */
    });
    /* assert on the output */
    
    This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
        at __scopeRadio (/Users/anavale/src/pluto/node_modules/@radix-ui/react-radio-group/dist/packages/react/radio-group/src/Radio.tsx:36:7)
        at children (/Users/anavale/src/pluto/node_modules/@radix-ui/react-slot/dist/packages/react/slot/src/Slot.tsx:61:11)
        at children (/Users/anavale/src/pluto/node_modules/@radix-ui/react-slot/dist/packages/react/slot/src/Slot.tsx:13:11)
        at asChild (/Users/anavale/src/pluto/node_modules/@radix-ui/react-primitive/dist/packages/react/primitive/src/Primitive.tsx:44:13)
        at children (/Users/anavale/src/pluto/node_modules/@radix-ui/react-slot/dist/packages/react/slot/src/Slot.tsx:61:11)

I started an investigation on it and saw that we need to synchronize all the "testing-library" libs or we can have these issues (unfortunately I don't know how to explain this better). But this thread helped me on find the issue.

Testing the change

  • Write your testing instructions here

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Non-Breaking Change (change to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Development

  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached.

@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

🦋 Changeset detected

Latest commit: bbc9848

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

This PR includes changesets to release 1 package
Name Type
@localyze-pluto/eslint-config 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

Copy link
Contributor

@blumaa blumaa left a comment

Choose a reason for hiding this comment

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

🔥

@github-actions
Copy link
Contributor

Size Change: +4 B (0%)

Total Size: 30.2 kB

Filename Size Change
packages/design-tokens/dist/js/border-radius.js 181 B +1 B (+1%)
packages/design-tokens/dist/js/border-style.js 141 B -1 B (-1%)
packages/design-tokens/dist/js/border-width.js 146 B +1 B (+1%)
packages/design-tokens/dist/js/colors.js 866 B -1 B (0%)
packages/design-tokens/dist/js/font-family.js 146 B +1 B (+1%)
packages/design-tokens/dist/js/font-weight.js 158 B -1 B (-1%)
packages/design-tokens/dist/js/size.js 248 B +1 B (0%)
packages/design-tokens/dist/js/space.js 426 B +1 B (0%)
packages/design-tokens/dist/js/z-index.js 169 B +2 B (+1%)
ℹ️ View Unchanged
Filename Size
packages/components/dist/index.js 23.3 kB
packages/design-tokens/dist/index.js 2.62 kB
packages/design-tokens/dist/js/font-size.js 199 B
packages/design-tokens/dist/js/line-height.js 205 B
packages/theme/dist/index.js 1.43 kB

compressed-size-action

@apvale apvale merged commit 3bcf532 into main Oct 18, 2023
@apvale apvale deleted the fix-warnings-on-tests branch October 18, 2023 14:57
@alpacatron alpacatron mentioned this pull request Oct 18, 2023
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.

2 participants