-
Notifications
You must be signed in to change notification settings - Fork 221
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
UUID dep is out of date and throwing a warning on install #1106
Comments
NicholasBoll
added a commit
to NicholasBoll/canvas-kit
that referenced
this issue
Jan 5, 2022
6 tasks
6 tasks
workday-canvas-kit
pushed a commit
that referenced
this issue
Jan 7, 2022
Our current id generation has issues. - It generates very long ids that add noise to the page - It is possible to generate a blank id - Id generation is slow - Snapshot tests require mocking the `uuid` module Fixes: #1311, #1106, #664, #602 [category:Hooks] Release Note: **NOTE for jest snapshots**: This change removes the `uuid` package and instead will generate a one-time client seed and then create auto-incrementing ids. This change will not break UI or automated UI tests. It will break snapshot tests however. Previously, the only way to get stable ids for snapshot tests was to mock the `uuid` module. This was an implementation detail. To make snapshots work again, add the following to your jest setup file: ```ts import {setUniqueSeed, resetUniqueIdCount} from '@workday/canvas-kit-react/common'; beforeEach(() => { setUniqueSeed('a'); // force set the seed resetUniqueIdCount(); // reset the unique id count }); ``` This will ensure each Jest snapshot has ids that look like `a0` and `a1` and will be the same every time the snapshot is run. Do not use these methods in production though - it may lead to inaccessible applications due to IDREF collisions.
Closed by #1408 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
When I installed our packages, I got the following warning:
To Reproduce
npx create-react-app test-app cd test-app yarn add @workday/canvas-kit-react
Expected Behavior
No warnings
Actual Results
Browser (if applicable)
n/a
Link to repl or repo (highly encouraged)
n/a
The text was updated successfully, but these errors were encountered: