Skip to content

Commit c52dafa

Browse files
committed
fix messagelistactivity tests
1 parent a8f3241 commit c52dafa

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

app/src/androidTest/java/com/twilio/conversations/app/ui/MessageListActivityTest.kt

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -516,38 +516,29 @@ class MessageListActivityTest {
516516
withText(
517517
Formatter.formatShortFileSize(
518518
InstrumentationRegistry.getInstrumentation().targetContext,
519-
message.mediaSize ?: 0
519+
message.attachmentsList.first().size ?: 0
520520
)
521521
)
522522
)
523523
}
524+
// For messages with attachments, check within the message item
525+
// The attachment views are now nested inside an attachments container
524526
WaitForViewMatcher.assertOnView(
525527
atPosition(
526528
index, allOf(
527529
withId(R.id.message_item),
528-
allOf(
529-
hasDescendant(
530-
allOf(
531-
withId(R.id.attachment_icon),
532-
hasSibling(
533-
allOf(
534-
withId(R.id.attachment_file_name),
535-
withText(message.attachmentsList.first().fileName)
536-
)
537-
)
538-
)
539-
),
540-
hasDescendant(
541-
allOf(
542-
withId(R.id.attachment_progress),
543-
withEffectiveVisibility(
544-
if (message.attachmentsList.first().downloadState == DOWNLOADING)
545-
Visibility.VISIBLE else Visibility.GONE
546-
)
530+
hasDescendant(withId(R.id.attachment_file_name)),
531+
hasDescendant(withText(message.attachmentsList.first().fileName)),
532+
hasDescendant(
533+
allOf(
534+
withId(R.id.attachment_progress),
535+
withEffectiveVisibility(
536+
if (message.attachmentsList.first().downloadState == DOWNLOADING)
537+
Visibility.VISIBLE else Visibility.GONE
547538
)
548-
),
549-
mediaMatcher
550-
)
539+
)
540+
),
541+
mediaMatcher
551542
)
552543
), matches(isCompletelyDisplayed())
553544
)

0 commit comments

Comments
 (0)