Replies: 3 comments
-
Currently, it is not supported. In one of the next releases, new HeadlessMantineProvider component will be added. This component will remove every extra styles. |
Beta Was this translation helpful? Give feedback.
-
In my case I use nested |
Beta Was this translation helpful? Give feedback.
-
Is there any drawback in just using this
in tests? This ignores the |
Beta Was this translation helpful? Give feedback.
-
Dependencies check up
What version of @mantine/* packages do you have in package.json?
^7.4.1
What package has an issue?
@mantine/core
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
Chrome
Describe the bug
I'm using Jest Snapshot Testing for some of my components. I've noticed that a
<style data-mantine-styles="classes">
is automatically as child of<MantineProvider>
. After taking a look on code, I could confirm that here:https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/core/src/core/MantineProvider/MantineProvider.tsx#L92
That introduces noise to the snapshot testing, because the snapshot tests fail even for changes that are not directly related to the tested component, like breakpoints.
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
<MantineClasses>
overindex.ts
file, so we can mock it and prevent the behavior OR<MantineClasses>
, just like it was made for<MantineCssVariables>
.Self-service
Beta Was this translation helpful? Give feedback.
All reactions