-
Notifications
You must be signed in to change notification settings - Fork 3
Add E2E tests for InputAccessoryView #17
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
base: master
Are you sure you want to change the base?
Conversation
AnshG714
left a comment
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.
This looks good to me!
| ); | ||
| }); | ||
|
|
||
| it('Send button should show alert on press', async () => { |
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.
Ideally, the test title should read like a sentence: "it should show alert on press", which in the test runner expands to InputAccessoryView should show alert on press.
However, that is not an appropriate description of our test case, because the InputAccessoryView only handles the positioning of the element, and not the click of a button.
Ideally, a test for InputAccessoryView would check that the component moves as keyboard is moved, but as discussed, that's currently not supported by Detox. So instead, maybe a better test case here is to say, InputAccessoryView should be visible (where we test that the element is visible on screen), and InputAccessoryView should be interactable, where we test that the button is pressed as tested below?
An additional good test would be to bring up the keyboard by focusing on a TextInput, and ensuring the element is still visible and tappable before and after the keyboard is focused, and dismissed.
There's many ways to do this, none ideal, but that's what I would do.
jevakallio
left a comment
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.
The implementation is looking good! The test case description could be improved somewhat (see line comments)
|
Thank you @jevakallio for the comments. I've updated the tests accordingly. |
jevakallio
left a comment
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! I'm going to hold off merging this, I think we're going to start a new long lived branch and merge these changes into it.
Summary
Fixes #7
Added E2E tests for the InputAccessoryView component.
Changelog
[IOS] [Added] - Integration test for the pressable component
Test Plan
On running the following commands
The output is as shown below: