mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Add missing test on this Presenter
This commit is contained in:
+36
@@ -488,6 +488,42 @@ class MessageComposerPresenterTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `present - create poll`() = runTest {
|
||||||
|
val room = FakeMatrixRoom()
|
||||||
|
val presenter = createPresenter(this, room = room)
|
||||||
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
|
presenter.present()
|
||||||
|
}.test {
|
||||||
|
skipItems(1)
|
||||||
|
val initialState = awaitItem()
|
||||||
|
initialState.eventSink(MessageComposerEvents.AddAttachment)
|
||||||
|
val attachmentOpenState = awaitItem()
|
||||||
|
assertThat(attachmentOpenState.showAttachmentSourcePicker).isTrue()
|
||||||
|
initialState.eventSink(MessageComposerEvents.PickAttachmentSource.Poll)
|
||||||
|
val finalState = awaitItem()
|
||||||
|
assertThat(finalState.showAttachmentSourcePicker).isFalse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `present - share location`() = runTest {
|
||||||
|
val room = FakeMatrixRoom()
|
||||||
|
val presenter = createPresenter(this, room = room)
|
||||||
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
|
presenter.present()
|
||||||
|
}.test {
|
||||||
|
skipItems(1)
|
||||||
|
val initialState = awaitItem()
|
||||||
|
initialState.eventSink(MessageComposerEvents.AddAttachment)
|
||||||
|
val attachmentOpenState = awaitItem()
|
||||||
|
assertThat(attachmentOpenState.showAttachmentSourcePicker).isTrue()
|
||||||
|
initialState.eventSink(MessageComposerEvents.PickAttachmentSource.Location)
|
||||||
|
val finalState = awaitItem()
|
||||||
|
assertThat(finalState.showAttachmentSourcePicker).isFalse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - Take photo`() = runTest {
|
fun `present - Take photo`() = runTest {
|
||||||
val room = FakeMatrixRoom()
|
val room = FakeMatrixRoom()
|
||||||
|
|||||||
Reference in New Issue
Block a user