[Bug]: v9 VR tests silently fail when griffel makeStyles
api is used directly for story rendering
#33861
Open
2 tasks done
Labels
Area: Storywright
Fluent UI react-components (v9)
Status: Blocked
Resolution blocked by another issue
Status: In PR
Storybook
Type: Bug 🐛
Component
Other...
Package version
latest
React version
17
Environment
Current Behavior
We already shipped new StoryWright features that reverted 2k+ lost VR test (#33759).
While migrating to the new SW version I ran into more issues within our stories and VR processing.
Actual issue description:
SW was silently failing when issues occured during processing VR test Story to obtain
Steps
definition.Whenever we use griffel
makeStyles
within VR Story in order to tweak test cases, SW would throw error and completely ignore these VR Test for processing.While running storybook
storyFn()
to obtain dynamically Story object and its props in order to acquiresteps
prop, it would throw on Griffel not able to find Context for text direction.Although the component render tree works as expected ↓
the under the hood mechanism of using
storyFn()
directly won't properly load the decorators hierarchy in order to get ReactContext
which is needed for Griffel.Affected VR Test:
Expected Behavior
VR test stories should be processed without issues
Reproduction
https://uifabric.visualstudio.com/fabricpublic/_build/results?buildId=370698&view=logs&j=d896371a-1583-5fe7-db02-473133ed56b2&t=282e32d3-e76c-5609-8d4f-bd5f29091ecb
Steps to reproduce
yarn nx run vr-tests-react-components:build-storybook
yarn nx run vr-tests-react-components:test-vr
Steps object is undefined
within logsAre you reporting an Accessibility issue?
no
Suggested severity
Urgent - No workaround and Products/sites are affected
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
The text was updated successfully, but these errors were encountered: