Conversation
| ); | ||
| }); | ||
|
|
||
| it('Send button should show alert on press', async () => { |
There was a problem hiding this comment.
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.
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.
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: