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

Test Snapshot failing in Mantine v6, Regenerated className gash #3676

Closed
rasyidf opened this issue Mar 4, 2023 · 4 comments
Closed

Test Snapshot failing in Mantine v6, Regenerated className gash #3676

rasyidf opened this issue Mar 4, 2023 · 4 comments

Comments

@rasyidf
Copy link

rasyidf commented Mar 4, 2023

What package has an issue

@mantine/core

Describe the bug

A problem has been identified with Mantine v6 library that is impacting snapshot testing. When attempting to match the snapshot, it is observed that the snapshot keeps changing with each update, making it challenging to perform reliable tests. This issue was not present in the previous version, Mantine v5.

Based on the available information, it appears that the issue may be related to the class hash generator (as shown below). However, further investigation is necessary to confirm this hypothesis and identify the root cause of the problem.

image

What version of @mantine/hooks page do you have in package.json?

6.0.0

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

No response

@rasyidf rasyidf changed the title Testing failing in mantine v6 Test Snapshot failing in Mantine v6, Regenerated className gash Mar 4, 2023
@rtivital
Copy link
Member

rtivital commented Mar 4, 2023

You can provide a static id if you do not want a random id to be generated – id="your-static-id".

@7iomka
Copy link
Contributor

7iomka commented Mar 4, 2023

You can provide a static id if you do not want a random id to be generated – id="your-static-id".

hm, but why this behavior differs from v5?

@rtivital
Copy link
Member

rtivital commented Mar 4, 2023

Logic to generate ids was changed to prevent incorrect browser autocomplete to show up in Chrome and Safari.

@rasyidf
Copy link
Author

rasyidf commented Mar 6, 2023

thank you, I've solved this problem by setting the Math.radom to constant in the test setup.

@rtivital rtivital closed this as completed Mar 6, 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

No branches or pull requests

3 participants