diff --git a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/textcomposer/MessageComposerPresenterTest.kt b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/textcomposer/MessageComposerPresenterTest.kt index c189e28c13..5e980514cb 100644 --- a/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/textcomposer/MessageComposerPresenterTest.kt +++ b/features/messages/impl/src/test/kotlin/io/element/android/features/messages/impl/textcomposer/MessageComposerPresenterTest.kt @@ -87,10 +87,13 @@ import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import org.junit.Rule import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner import uniffi.wysiwyg_composer.MentionsState import java.io.File @Suppress("LargeClass") +@RunWith(RobolectricTestRunner::class) class MessageComposerPresenterTest { @get:Rule val warmUpRule = WarmUpRule() @@ -875,6 +878,19 @@ class MessageComposerPresenterTest { } } + @Test + fun `present - send uri`() = runTest { + val presenter = createPresenter(this) + moleculeFlow(RecompositionMode.Immediate) { + val state = presenter.present() + remember(state, state.richTextEditorState.messageHtml) { state } + }.test { + val initialState = awaitFirstItem() + initialState.eventSink.invoke(MessageComposerEvents.SendUri(Uri.parse("content://uri"))) + waitForPredicate { mediaPreProcessor.processCallCount == 1 } + } + } + @Test fun `present - handle typing notice event`() = runTest { val room = FakeMatrixRoom()