Skip to content

Warnings of test not wrapped in act since 9.3.2 #1275

Closed
@joaopedrodcf

Description

@joaopedrodcf
  • @testing-library/dom version: 9.3.2 or greater
  • Testing Framework and version: jest 29.7.0
  • DOM Environment: jest-environment-jsdom 29.7.0

Relevant code or config:

    it('...' () => {
        const user = userEvent.setup();
        render(<ResetPasswordForm />);

        const newPasswordInput = screen.getByLabelText(...);

        // The test will start warning here as can be seen in the screenshot below
        await user.type(newPasswordInput, ...);

What you did:

Upgraded from 9.3.1 to 9.3.2

What happened:

The warnings started appearing all over the place

Reproduction:

Problem description:

Upgrading from "@testing-library/dom": "9.3.1", to `"@testing-library/dom": "9.3.2" will start showing warnings in almost every test.
All the warnings are related with not wrapping in act.
image

Suggested solution:

I don't have suggested solution as I never checked the codebase of dom testing library, probably something changed from version 9.3.1 to 9.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions