You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was adding DOM snapshot tests for a react page using StackedBar with react-testing-library snapshots and vitest, but a clippath id was different on every test run, so it would fail the snapshot comparison.
As a workaround you can mock crypto.getRandomValues that is used in the guid util function (https://github.com/f5/unovis/blob/main/packages/ts/src/utils/misc.ts#L6), but it would be good for snapshot testing to work out of the box and I don't know that these ids need to be random guids.
The text was updated successfully, but these errors were encountered:
Seen in the
StackedBar
component, which gets a clippath id fromXYComponentCore
https://github.com/f5/unovis/blob/main/packages/ts/src/containers/xy-container/index.ts#L51
I was adding DOM snapshot tests for a react page using
StackedBar
with react-testing-library snapshots and vitest, but aclippath
id was different on every test run, so it would fail the snapshot comparison.As a workaround you can mock
crypto.getRandomValues
that is used in theguid
util function (https://github.com/f5/unovis/blob/main/packages/ts/src/utils/misc.ts#L6), but it would be good for snapshot testing to work out of the box and I don't know that these ids need to be random guids.The text was updated successfully, but these errors were encountered: