-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a50624c
commit 70eb92a
Showing
8 changed files
with
81 additions
and
57 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
paymentsheet/src/test/java/com/stripe/android/common/ui/ClickWorkaround.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.stripe.android.common.ui | ||
|
||
import androidx.compose.ui.input.key.Key | ||
import androidx.compose.ui.test.ExperimentalTestApi | ||
import androidx.compose.ui.test.SemanticsNodeInteraction | ||
import androidx.compose.ui.test.invokeGlobalAssertions | ||
import androidx.compose.ui.test.performKeyInput | ||
import androidx.compose.ui.test.requestFocus | ||
|
||
fun SemanticsNodeInteraction.performClickWithKeyboard(): SemanticsNodeInteraction { | ||
@OptIn(ExperimentalTestApi::class) | ||
return this.invokeGlobalAssertions() | ||
.requestFocus() | ||
.performKeyInput { | ||
keyDown(Key.Enter) | ||
keyUp(Key.Enter) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.