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

fix(nova-react-test-utils): improve types for WithoutFragmentRefs #114

Merged
merged 6 commits into from
Sep 20, 2024

Conversation

sjwilczynski
Copy link
Contributor

@sjwilczynski sjwilczynski commented Sep 20, 2024

We added a utility WithoutFragmentRefs that makes sure Typescript doesn't want us to provide args that are defined on referenceEntries. However, the way we wrote the type impacts the render function of a Story as well, needing us to either disabled type check there or provide not correct props. In this PR we adjust the type to be StoryObjWithoutFragmentRefs which removes the props defined in referenceEntries from args only, instead of all types in StoryObj. As the type was pretty complex due to how StoryObj handles required vs optional args and how it is able to handle args defined on meta object we also add type based tests in types.d-test.ts file

@sjwilczynski sjwilczynski enabled auto-merge (squash) September 20, 2024 12:41
@sjwilczynski sjwilczynski merged commit f586941 into microsoft:main Sep 20, 2024
2 checks passed
@sjwilczynski sjwilczynski deleted the user/stwilczy/betterType branch September 20, 2024 13:28
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

Successfully merging this pull request may close these issues.

2 participants