Skip to content

Commit e00d939

Browse files
committed
tests: Fixup tests.
1 parent c3abb6b commit e00d939

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/crypto/historyvisible/HistoryVisibleStatePresenterTest.kt

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,23 @@ class HistoryVisibleStatePresenterTest {
2222
@get:Rule
2323
val warmUpRule = WarmUpRule()
2424

25-
@Test
26-
fun `present - initial with room shared, unencrypted`() = runTest {
27-
val room = FakeJoinedRoom()
28-
room.givenRoomInfo(aRoomInfo(historyVisibility = RoomHistoryVisibility.Shared, isEncrypted = false))
29-
val presenter = createHistoryVisibleStatePresenter(room)
30-
presenter.test {
31-
val initialState = awaitItem()
32-
assertThat(initialState.showAlert).isFalse()
33-
val nextState = awaitItem()
34-
assertThat(nextState.showAlert).isFalse()
25+
@Test
26+
fun `present - initial with room shared, unencrypted`() = runTest {
27+
val room = FakeJoinedRoom()
28+
room.givenRoomInfo(aRoomInfo(historyVisibility = RoomHistoryVisibility.Shared, isEncrypted = false))
29+
val presenter = createHistoryVisibleStatePresenter(room)
30+
presenter.test {
31+
assertThat(awaitItem().showAlert).isFalse()
32+
}
3533
}
36-
}
3734

3835
@Test
3936
fun `present - initial with room joined, encrypted`() = runTest {
4037
val room = FakeJoinedRoom()
4138
room.givenRoomInfo(aRoomInfo(historyVisibility = RoomHistoryVisibility.Joined, isEncrypted = false))
4239
val presenter = createHistoryVisibleStatePresenter(room)
4340
presenter.test {
44-
val initialState = awaitItem()
45-
assertThat(initialState.showAlert).isFalse()
46-
val nextState = awaitItem()
47-
assertThat(nextState.showAlert).isFalse()
41+
assertThat(awaitItem().showAlert).isFalse()
4842
}
4943
}
5044

@@ -86,9 +80,6 @@ fun `present - initial with room shared, unencrypted`() = runTest {
8680
)
8781

8882
presenter.test {
89-
// initial state
90-
assertThat(awaitItem().showAlert).isFalse()
91-
9283
// emitted state from room info assignment
9384
assertThat(awaitItem().showAlert).isFalse()
9485

0 commit comments

Comments
 (0)