Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry.captureException causes a storyshot to fail #2257

Open
flacial opened this issue Sep 4, 2022 · 0 comments
Open

Sentry.captureException causes a storyshot to fail #2257

flacial opened this issue Sep 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@flacial
Copy link
Member

flacial commented Sep 4, 2022

Problem

For some reason, when using Sentry.captureException(error) in the ProfileImageInfo component, the storyshots test throw:

Ran all test suites matching /__tests__\/storyshots.test.js/i.
  console.error
    Warning: An update to DiscordBar 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 DiscordBar (c0d3-app/components/DiscordBar.tsx:740:12)
        at div
        at div
        at div
        at Layout (c0d3-app/components/Layout.tsx:205:3)
        at Curriculum (c0d3-app/pages/curriculum.tsx:1761:3)
        at ApolloProvider (c0d3-app/node_modules/@apollo/client/react/context/ApolloProvider.js:5:21)
        at MockedProvider (c0d3-app/node_modules/@apollo/client/utilities/testing/mocking/MockedProvider.js:10:28)
        at storyFn

It seems to be related to #715

@flacial flacial added the bug Something isn't working label Sep 4, 2022
flacial added a commit to flacial/c0d3-app that referenced this issue Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant