-
Notifications
You must be signed in to change notification settings - Fork 734
POC Export of testkits #1925
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
POC Export of testkits #1925
Conversation
@@ -0,0 +1,4 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small hack to make the testkits available under
import {} from 'react-native-ui-lib/testkit'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge thanks to @amitdahan for helping out with this one
return { | ||
accessible: true, | ||
accessibilityRole: 'switch', | ||
accessibilityStates: disabled ? ['disabled'] : value ? ['checked'] : ['unchecked'], | ||
accessibilityState: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed accessibilityState to follow Accessibility docs of react-native
https://reactnative.dev/docs/accessibility#accessibilitystate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked with building & running the app locally, I see no errors regarding this change so I guess it's ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I tried testing with Accessibility Inspector locally but it doesn't show the state value so I'll verify again on real device after we merge
3e38eb8
to
79ab237
Compare
Description
Exposed testkits to consumers via
react-native-ui-lib/testkit
The main approach here was to create the testkit and test the component with it's testkit.
this way we'll have a good coverage of both the component, and the testkit in a single test file
if the component breaks, the test will fail
if there's some changes under the hood and the testkit is not updated, the tests will also fail
Changelog
Expose initial POC of testkit for our components