Skip to content

Commit ccb098d

Browse files
committedApr 8, 2021
[Jetchat, Owl] Update tests for new semantics behavior.
Semantics merging behavior changed in beta04. Work around this by using the unmerged tree for now. https: //issuetracker.google.com/issues/184825850 Change-Id: I5c4ee8614ce2ffc581ee58bf344114426b2d4f9d
1 parent f31cf82 commit ccb098d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed
 

‎Jetchat/app/src/androidTest/java/com/example/compose/jetchat/ConversationTest.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ class ConversationTest {
116116
@Test
117117
fun jumpToBottom_snapsToBottomAfterUserInteracted() {
118118
// First swipe
119-
composeTestRule.onNodeWithTag(ConversationTestTag).performGesture {
119+
composeTestRule.onNodeWithTag(
120+
testTag = ConversationTestTag,
121+
useUnmergedTree = true // https://issuetracker.google.com/issues/184825850
122+
).performGesture {
120123
this.swipe(
121124
start = this.center,
122125
end = Offset(this.center.x, this.center.y + 500),
@@ -160,7 +163,8 @@ class ConversationTest {
160163
private fun openEmojiSelector() =
161164
composeTestRule
162165
.onNodeWithContentDescription(
163-
composeTestRule.activity.getString(R.string.emoji_selector_bt_desc)
166+
label = composeTestRule.activity.getString(R.string.emoji_selector_bt_desc),
167+
useUnmergedTree = true // https://issuetracker.google.com/issues/184825850
164168
)
165169
.performClick()
166170
}

‎Jetchat/app/src/androidTest/java/com/example/compose/jetchat/UserInputTest.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ class UserInputTest {
154154

155155
private fun openEmojiSelector() =
156156
composeTestRule
157-
.onNodeWithContentDescription(activity.getString(R.string.emoji_selector_bt_desc))
157+
.onNodeWithContentDescription(
158+
label = activity.getString(R.string.emoji_selector_bt_desc),
159+
useUnmergedTree = true // https://issuetracker.google.com/issues/184825850
160+
)
158161
.performClick()
159162

160163
private fun assertEmojiSelectorIsDisplayed() =

‎Owl/app/src/androidTest/java/com/example/owl/ui/NavigationTest.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ class NavigationTest {
6868
startActivity()
6969
// The first screen should be the onboarding screen.
7070
// Assert that the FAB label for the onboarding screen exists:
71-
composeTestRule.onNodeWithContentDescription(getOnboardingFabLabel()).assertExists()
71+
composeTestRule.onNodeWithContentDescription(
72+
label = getOnboardingFabLabel(),
73+
useUnmergedTree = true // https://issuetracker.google.com/issues/184825850
74+
).assertExists()
7275
}
7376

7477
@Test
@@ -78,7 +81,10 @@ class NavigationTest {
7881

7982
// Navigate to the next screen by clicking on the FAB
8083
val fabLabel = getOnboardingFabLabel()
81-
composeTestRule.onNodeWithContentDescription(fabLabel).performClick()
84+
composeTestRule.onNodeWithContentDescription(
85+
label = fabLabel,
86+
useUnmergedTree = true // https://issuetracker.google.com/issues/184825850
87+
).performClick()
8288

8389
// The first course should be shown
8490
composeTestRule.onNodeWithText(

0 commit comments

Comments
 (0)