-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat: setup interaction testing #1895
Conversation
…grade-react-native-72.3
iPhone6: { | ||
name: 'iPhone 6', | ||
styles: { | ||
height: '667px', | ||
width: '375px', | ||
}, | ||
type: 'mobile', | ||
}, |
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.
Does the MINIMAL_VIEWPORTS doesn't have any mobile viewport by default?
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.
they have weird viewports like iPhone-5 or smaller so i added standard one
await expect(onChange).toBeCalledWith(0); | ||
getByText(/Single Flow To Collect And Disburse Payments/)?.scrollIntoView({ behavior: 'smooth' }); | ||
await sleep(1000); | ||
await expect(onChange).toBeCalledWith(3); |
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.
Actually we should also do this, after all the toBeCalledWith are done we should do another check for.
onChange.toBeCalledTimes(3);
This will ensure that onChange hasn't been called twice or more than it needs to be.
This we can add in all the tests.
|
||
TestAutoPlay.play = async ({ canvasElement }) => { | ||
const { getByRole } = within(canvasElement); | ||
await sleep(8000); |
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.
Before this we should do onChange.not.toHaveBeenCalled()
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.
LGTM
Co-authored-by: Chaitanya Deorukhkar <deorukhkarchaitanya@gmail.com> Co-authored-by: Nitin Kumar <nitin.kumar@razorpay.com> Co-authored-by: Nitin Kumar <snitin315@gmail.com> Co-authored-by: anuraghazra <anurag.hazra@razorpay.com>
This PR does the following things:
Run Interaction Test
label or trigger it manually from the actions tab