Skip to content

Commit

Permalink
Fix UI Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JcMinarro committed Jul 10, 2024
1 parent 45f7a31 commit 9c2f085
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package io.getstream.chat.android.uitests.snapshot.compose.channels

import io.getstream.chat.android.compose.state.channels.list.ChannelItemState
import io.getstream.chat.android.compose.state.channels.list.ItemState.ChannelItemState
import io.getstream.chat.android.compose.ui.channels.list.ChannelItem
import io.getstream.chat.android.uitests.snapshot.compose.ComposeScreenshotTest
import io.getstream.chat.android.uitests.util.TestData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package io.getstream.chat.android.uitests.snapshot.compose.channels

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import io.getstream.chat.android.compose.state.channels.list.ChannelItemState
import io.getstream.chat.android.compose.state.channels.list.ChannelsState
import io.getstream.chat.android.compose.state.channels.list.ItemState.ChannelItemState
import io.getstream.chat.android.compose.ui.channels.list.ChannelList
import io.getstream.chat.android.uitests.snapshot.compose.ComposeScreenshotTest
import io.getstream.chat.android.uitests.util.TestData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package io.getstream.chat.android.uitests.snapshot.compose.messages

import io.getstream.chat.android.compose.ui.messages.list.MessageContainer
import io.getstream.chat.android.models.Message
import io.getstream.chat.android.models.ReactionSortingByCount
import io.getstream.chat.android.ui.common.state.messages.list.DateSeparatorItemState
import io.getstream.chat.android.ui.common.state.messages.list.SystemMessageItemState
import io.getstream.chat.android.ui.common.state.messages.list.ThreadDateSeparatorItemState
Expand All @@ -30,16 +31,25 @@ class MessageContainerTest : ComposeScreenshotTest() {

@Test
fun dateSeparator() = runScreenshotTest {
MessageContainer(DateSeparatorItemState(TestData.date1()))
MessageContainer(
DateSeparatorItemState(TestData.date1()),
reactionSorting = ReactionSortingByCount,
)
}

@Test
fun threadSeparator() = runScreenshotTest {
MessageContainer(ThreadDateSeparatorItemState(date = Date(), replyCount = 5))
MessageContainer(
ThreadDateSeparatorItemState(date = Date(), replyCount = 5),
reactionSorting = ReactionSortingByCount,
)
}

@Test
fun systemMessage() = runScreenshotTest {
MessageContainer(SystemMessageItemState(Message(text = "System message")))
MessageContainer(
SystemMessageItemState(Message(text = "System message")),
reactionSorting = ReactionSortingByCount,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.getstream.chat.android.uitests.snapshot.compose.messages

import io.getstream.chat.android.compose.ui.messages.list.MessageItem
import io.getstream.chat.android.models.ReactionSortingByCount
import io.getstream.chat.android.ui.common.state.messages.list.MessageItemState
import io.getstream.chat.android.uitests.snapshot.compose.ComposeScreenshotTest
import io.getstream.chat.android.uitests.util.TestData
Expand All @@ -33,6 +34,7 @@ class MessageItemTest : ComposeScreenshotTest() {
showMessageFooter = true,
),
onLongItemClick = {},
reactionSorting = ReactionSortingByCount,
)
}

Expand All @@ -45,6 +47,7 @@ class MessageItemTest : ComposeScreenshotTest() {
showMessageFooter = true,
),
onLongItemClick = {},
reactionSorting = ReactionSortingByCount,
)
}

Expand All @@ -58,6 +61,7 @@ class MessageItemTest : ComposeScreenshotTest() {
showMessageFooter = true,
),
onLongItemClick = {},
reactionSorting = ReactionSortingByCount,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.getstream.chat.android.uitests.snapshot.compose.messages

import io.getstream.chat.android.compose.ui.messages.list.MessageList
import io.getstream.chat.android.models.ReactionSortingByCount
import io.getstream.chat.android.ui.common.state.messages.list.MessageItemState
import io.getstream.chat.android.ui.common.state.messages.list.MessageListState
import io.getstream.chat.android.uitests.snapshot.compose.ComposeScreenshotTest
Expand Down Expand Up @@ -50,6 +51,7 @@ class MessageListTest : ComposeScreenshotTest() {
),
currentUser = TestData.user1(),
),
reactionSorting = ReactionSortingByCount,
)
}

Expand Down Expand Up @@ -81,6 +83,7 @@ class MessageListTest : ComposeScreenshotTest() {
),
currentUser = TestData.user1(),
),
reactionSorting = ReactionSortingByCount,
)
}
}

0 comments on commit 9c2f085

Please sign in to comment.