Skip to content

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

Merged
merged 20 commits into from
Apr 6, 2022
Merged

POC Export of testkits #1925

merged 20 commits into from
Apr 6, 2022

Conversation

marik22312
Copy link

@marik22312 marik22312 commented Mar 28, 2022

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

@@ -0,0 +1,4 @@
{
Copy link
Author

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'

Copy link
Author

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: {
Copy link
Author

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

Copy link
Author

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

Copy link
Collaborator

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

@marik22312 marik22312 force-pushed the poc/exported-testkit branch from 3e38eb8 to 79ab237 Compare April 3, 2022 08:26
@marik22312 marik22312 requested a review from ethanshar April 3, 2022 08:46
@ethanshar ethanshar enabled auto-merge (squash) April 6, 2022 09:03
@ethanshar ethanshar merged commit c6ac90e into master Apr 6, 2022
@ethanshar ethanshar deleted the poc/exported-testkit branch June 13, 2022 08:17
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