Add missing test on this Presenter
This commit is contained in:
parent
d19b624c6f
commit
658c59d489
1 changed files with 36 additions and 0 deletions
|
|
@ -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
|
||||
fun `present - Take photo`() = runTest {
|
||||
val room = FakeMatrixRoom()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue