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

Textarea autosize causing tests to break with "type is invalid" error #5393

Closed
1 of 2 tasks
superflav opened this issue Dec 8, 2023 · 1 comment
Closed
1 of 2 tasks
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)

Comments

@superflav
Copy link

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.3.0

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

None

Describe the bug

When running tests against a component that uses Textarea with autosize specified, the following error is encountered:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

    Check the render method of `@mantine/core/Box`.

To recreate this problem:

  1. Clone https://github.com/mantinedev/next-app-template
  2. Add a Textarea with autosize to Welcome.tsx
<Textarea autosize minRows={4} maxRows={4} />
  1. Run tests
yarn run test
  1. Welcome.test.tsx fails with
 FAIL  components/Welcome/Welcome.test.tsx
  Welcome component
    ✕ has correct Next.js theming section link (88 ms)

  ● Welcome component › has correct Next.js theming section link

    Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

    Check the render method of `@mantine/core/Box`.

      4 |
      5 | export function render(ui: React.ReactNode) {
    > 6 |   return testingLibraryRender(<>{ui}</>, {
        |                              ^
      7 |     wrapper: ({ children }: { children: React.ReactNode }) => (
      8 |       <MantineProvider theme={theme}>{children}</MantineProvider>
      9 |     ),

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
rtivital added a commit that referenced this issue Dec 9, 2023
@rtivital rtivital added the Fixed patch Completed issues that will be published with next patch (1.0.X) label Dec 9, 2023
@rtivital
Copy link
Member

Fixed in 7.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed patch Completed issues that will be published with next patch (1.0.X)
Projects
None yet
Development

No branches or pull requests

2 participants