Merge branch 'develop' into feature/fga/user_moderation_bottomsheet
This commit is contained in:
commit
cfbbccb09d
647 changed files with 7223 additions and 2888 deletions
|
|
@ -38,6 +38,9 @@ internal fun CallMenuItem(
|
|||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
when (roomCallState) {
|
||||
RoomCallState.Unavailable -> {
|
||||
Box(modifier)
|
||||
}
|
||||
is RoomCallState.StandBy -> {
|
||||
StandByCallMenuItem(
|
||||
roomCallState = roomCallState,
|
||||
|
|
|
|||
|
|
@ -103,10 +103,12 @@ internal fun TimelineItemCallNotifyView(
|
|||
|
||||
@PreviewsDayNight
|
||||
@Composable
|
||||
internal fun TimelineItemCallNotifyViewPreview() {
|
||||
ElementPreview {
|
||||
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
RoomCallStateProvider().values.forEach { roomCallState ->
|
||||
internal fun TimelineItemCallNotifyViewPreview() = ElementPreview {
|
||||
Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) {
|
||||
RoomCallStateProvider()
|
||||
.values
|
||||
.filter { it !is RoomCallState.Unavailable }
|
||||
.forEach { roomCallState ->
|
||||
TimelineItemCallNotifyView(
|
||||
event = aTimelineItemEvent(content = TimelineItemCallNotifyContent()),
|
||||
roomCallState = roomCallState,
|
||||
|
|
@ -114,6 +116,5 @@ internal fun TimelineItemCallNotifyViewPreview() {
|
|||
onJoinCallClick = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,5 +38,29 @@
|
|||
<string name="screen_room_timeline_reactions_show_less">"Dangos llai"</string>
|
||||
<string name="screen_room_timeline_reactions_show_more">"Dangos rhagor"</string>
|
||||
<string name="screen_room_timeline_read_marker_title">"Newydd"</string>
|
||||
<plurals name="screen_room_timeline_state_changes">
|
||||
<item quantity="zero">"%1$d newid ystafelloedd"</item>
|
||||
<item quantity="one">"%1$d newid ystafell"</item>
|
||||
<item quantity="two">"%1$d newid ystafell"</item>
|
||||
<item quantity="few">"%1$d newid ystafell"</item>
|
||||
<item quantity="many">"%1$d newid ystafell"</item>
|
||||
<item quantity="other">"%1$d newid ystafell"</item>
|
||||
</plurals>
|
||||
<plurals name="screen_room_typing_many_members">
|
||||
<item quantity="zero">"%1$s, %2$s a %3$d arall"</item>
|
||||
<item quantity="one">"%1$s, %2$s a %3$d arall"</item>
|
||||
<item quantity="two">"%1$s, %2$s a %3$d arall"</item>
|
||||
<item quantity="few">"%1$s, %2$s a %3$d arall"</item>
|
||||
<item quantity="many">"%1$s, %2$s a %3$d arall"</item>
|
||||
<item quantity="other">"%1$s, %2$s a %3$d arall"</item>
|
||||
</plurals>
|
||||
<plurals name="screen_room_typing_notification">
|
||||
<item quantity="zero">"Mae %1$s yn teipio"</item>
|
||||
<item quantity="one">"Mae %1$s yn teipio"</item>
|
||||
<item quantity="two">"Mae %1$s yn teipio"</item>
|
||||
<item quantity="few">"Mae %1$s yn teipio"</item>
|
||||
<item quantity="many">"Mae %1$s yn teipio"</item>
|
||||
<item quantity="other">"Mae %1$s yn teipio"</item>
|
||||
</plurals>
|
||||
<string name="screen_room_typing_two_members">"%1$s a %2$s"</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
<string name="emoji_picker_category_people">"Smileys & Menschen"</string>
|
||||
<string name="emoji_picker_category_places">"Reisen & Orte"</string>
|
||||
<string name="emoji_picker_category_symbols">"Symbole"</string>
|
||||
<string name="screen_report_content_block_user">"Benutzer blockieren"</string>
|
||||
<string name="screen_report_content_block_user_hint">"Prüfe, ob du alle aktuellen und zukünftigen Nachrichten dieses Benutzers ausblenden möchtest"</string>
|
||||
<string name="screen_report_content_explanation">"Diese Meldung wird an den Administrator deines Homeservers weitergeleitet. Dieser kann keine verschlüsselten Nachrichten lesen."</string>
|
||||
<string name="screen_report_content_block_user">"Nutzer blockieren"</string>
|
||||
<string name="screen_report_content_block_user_hint">"Prüfen Sie, ob Sie alle aktuellen und zukünftigen Nachrichten dieses Nutzers ausblenden wollen"</string>
|
||||
<string name="screen_report_content_explanation">"Diese Nachricht wird dem Administrator ihres Homeservers gemeldet. Dieser kann allerdings keine verschlüsselten Nachrichten lesen."</string>
|
||||
<string name="screen_report_content_hint">"Grund für die Meldung dieses Inhalts"</string>
|
||||
<string name="screen_room_attachment_source_camera">"Kamera"</string>
|
||||
<string name="screen_room_attachment_source_camera_photo">"Foto aufnehmen"</string>
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
<string name="screen_room_attachment_text_formatting">"Textformatierung"</string>
|
||||
<string name="screen_room_encrypted_history_banner">"Der Nachrichtenverlauf ist derzeit nicht verfügbar"</string>
|
||||
<string name="screen_room_encrypted_history_banner_unverified">"Der Nachrichtenverlauf ist nicht verfügbar. Verifiziere dieses Gerät, um deinen Nachrichtenverlauf zu sehen."</string>
|
||||
<string name="screen_room_invite_again_alert_message">"Möchtest du sie wieder einladen?"</string>
|
||||
<string name="screen_room_invite_again_alert_title">"Du bist allein in diesem Chat"</string>
|
||||
<string name="screen_room_invite_again_alert_message">"Möchten Sie sie erneut einladen?"</string>
|
||||
<string name="screen_room_invite_again_alert_title">"Sie sind in diesem Chat allein"</string>
|
||||
<string name="screen_room_mentions_at_room_subtitle">"Alle Mitglieder benachrichtigen"</string>
|
||||
<string name="screen_room_mentions_at_room_title">"Alle"</string>
|
||||
<string name="screen_room_retry_send_menu_send_again_action">"Erneut senden"</string>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<string name="screen_room_timeline_add_reaction">"Adicionar emoji"</string>
|
||||
<string name="screen_room_timeline_beginning_of_room">"Este é o início do %1$s."</string>
|
||||
<string name="screen_room_timeline_beginning_of_room_no_name">"Este é o início desta conversa."</string>
|
||||
<string name="screen_room_timeline_legacy_call">"Chamada não suportada. Pergunte se o chamador pode usar o novo aplicativo Element X."</string>
|
||||
<string name="screen_room_timeline_less_reactions">"Mostrar menos"</string>
|
||||
<string name="screen_room_timeline_message_copied">"Mensagem copiada"</string>
|
||||
<string name="screen_room_timeline_no_permission_to_post">"Você não tem permissão para postar nesta sala"</string>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<string name="emoji_picker_category_places">"Viagens e Lugares"</string>
|
||||
<string name="emoji_picker_category_symbols">"Símbolos"</string>
|
||||
<string name="screen_report_content_block_user">"Bloquear utilizador"</string>
|
||||
<string name="screen_report_content_block_user_hint">"Ativar para esconder todas as atuais e futuras mensagens deste utilizador"</string>
|
||||
<string name="screen_report_content_block_user_hint">"Ativar para ocultar todas as atuais e futuras mensagens deste utilizador"</string>
|
||||
<string name="screen_report_content_explanation">"Esta mensagem será denunciada ao administrador do teu servidor. Porém, não lhe será possível ler quaisquer mensagens cifradas."</string>
|
||||
<string name="screen_report_content_hint">"Razão de denúncia"</string>
|
||||
<string name="screen_room_attachment_source_camera">"Câmara"</string>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="emoji_picker_category_activity">"سرگرمیاں"</string>
|
||||
<string name="emoji_picker_category_flags">"جھنڈے"</string>
|
||||
<string name="emoji_picker_category_foods">"طعم و مشروب"</string>
|
||||
<string name="emoji_picker_category_nature">"حیوانات و فطرت"</string>
|
||||
<string name="emoji_picker_category_objects">"اشیاء"</string>
|
||||
<string name="emoji_picker_category_people">"مسکراہٹیں و لوگ"</string>
|
||||
<string name="emoji_picker_category_places">"سفر و مقامات"</string>
|
||||
<string name="emoji_picker_category_symbols">"علامتیں"</string>
|
||||
<string name="screen_report_content_block_user">"صارف کو مسدود کریں"</string>
|
||||
<string name="screen_report_content_block_user_hint">"پڑتال کریں کہ کیا آپ اس صارف سے تمام موجودہ اور مستقبلی پیغامات چھپانا چاہتے ہیں۔"</string>
|
||||
<string name="screen_report_content_explanation">"اس پیغام کی اطلاع آپکے منزلی خادم کے منتظم کو دی جائیگی۔ وہ کوئی مرموزکردہ پیغامات نہیں پڑھ سکیں گے۔"</string>
|
||||
<string name="screen_report_content_hint">"اس مواد کی اطلاع دینے کی وجہ"</string>
|
||||
<string name="screen_room_attachment_source_camera">"تصویرگر"</string>
|
||||
<string name="screen_room_attachment_source_camera_photo">"تصویر لیں"</string>
|
||||
<string name="screen_room_attachment_source_camera_video">"ویڈیو ثبت کریں"</string>
|
||||
<string name="screen_room_attachment_source_files">"منسلکہ"</string>
|
||||
<string name="screen_room_attachment_source_gallery">"تصویر اور ویڈیو مکتب"</string>
|
||||
<string name="screen_room_attachment_source_location">"مقام"</string>
|
||||
<string name="screen_room_attachment_source_poll">"رائے شماری"</string>
|
||||
<string name="screen_room_attachment_text_formatting">"متن کی تنسیق"</string>
|
||||
<string name="screen_room_encrypted_history_banner">"پیغام کی سرگزشت فی الحال دستیاب نہیں ہے"</string>
|
||||
<string name="screen_room_encrypted_history_banner_unverified">"اس کمرے میں پیغام کی سرگزشت دستیاب نہیں ہے۔ اپنے پیغام کی سرگزشت دیکھنے کے لیے اس آلے کی توثیق کریں۔"</string>
|
||||
<string name="screen_room_invite_again_alert_message">"کیا آپ انہیں واپس مدعو کرنا چاہیں گے؟"</string>
|
||||
<string name="screen_room_invite_again_alert_title">"آپ اس گفتگو میں تنہا ہیں"</string>
|
||||
<string name="screen_room_mentions_at_room_subtitle">"پورے کمرے کو مطلع کریں"</string>
|
||||
<string name="screen_room_mentions_at_room_title">"ہر کوئی"</string>
|
||||
<string name="screen_room_retry_send_menu_send_again_action">"دوبارہ بھیجیں"</string>
|
||||
<string name="screen_room_retry_send_menu_title">"آپ کا پیغام بھیجنے میں ناکام"</string>
|
||||
<string name="screen_room_timeline_add_reaction">"رمزِ تعبیری شامل کریں"</string>
|
||||
<string name="screen_room_timeline_beginning_of_room">"یہ %1$s کا آغاز ہے"</string>
|
||||
<string name="screen_room_timeline_beginning_of_room_no_name">"یہ اس گفتگو کا آغاز ہے"</string>
|
||||
<string name="screen_room_timeline_less_reactions">"کم دکھائیں"</string>
|
||||
<string name="screen_room_timeline_message_copied">"پیغام نقل کردہ"</string>
|
||||
<string name="screen_room_timeline_no_permission_to_post">"آپ کو اس کمرے میں پوسٹ کرنے کی اجازت نہیں ہے"</string>
|
||||
<string name="screen_room_timeline_reactions_show_less">"کم دکھائیں"</string>
|
||||
<string name="screen_room_timeline_reactions_show_more">"مزید دکھائیں"</string>
|
||||
<string name="screen_room_timeline_read_marker_title">"نیا"</string>
|
||||
<plurals name="screen_room_timeline_state_changes">
|
||||
<item quantity="one">"%1$d کمرے کی تبدیلی"</item>
|
||||
<item quantity="other">"%1$d کمرے کی تبدیلیاں"</item>
|
||||
</plurals>
|
||||
<plurals name="screen_room_typing_many_members">
|
||||
<item quantity="one">"%1$s، %2$s اور %3$d دیگر"</item>
|
||||
<item quantity="other">"%1$s، %2$s اور %3$d دیگر"</item>
|
||||
</plurals>
|
||||
<plurals name="screen_room_typing_notification">
|
||||
<item quantity="one">"%1$s تحریر کر رہا ہے"</item>
|
||||
<item quantity="other">"%1$s تحریر کر رہے ہیں"</item>
|
||||
</plurals>
|
||||
<string name="screen_room_typing_two_members">"%1$s اور %2$s"</string>
|
||||
</resources>
|
||||
|
|
@ -513,7 +513,17 @@ class AttachmentsPreviewPresenterTest {
|
|||
@Test
|
||||
fun `present - dismissing the progress dialog stops media upload with media queue`() = runTest {
|
||||
val onDoneListenerResult = lambdaRecorder<Unit> {}
|
||||
val presenter = createAttachmentsPreviewPresenter(mediaUploadOnSendQueueEnabled = true, onDoneListener = onDoneListenerResult)
|
||||
val presenter = createAttachmentsPreviewPresenter(
|
||||
room = FakeJoinedRoom(
|
||||
liveTimeline = FakeTimeline().apply {
|
||||
sendFileLambda = { _, _, _, _, _, _ ->
|
||||
Result.success(FakeMediaUploadHandler())
|
||||
}
|
||||
}
|
||||
),
|
||||
mediaUploadOnSendQueueEnabled = true,
|
||||
onDoneListener = onDoneListenerResult,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import io.element.android.libraries.matrix.test.timeline.FakeTimeline
|
|||
import io.element.android.libraries.matrix.test.timeline.LiveTimelineProvider
|
||||
import io.element.android.tests.testutils.WarmUpRule
|
||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
|
@ -91,13 +91,12 @@ class ForwardMessagesPresenterTest {
|
|||
}
|
||||
}
|
||||
|
||||
private fun CoroutineScope.aForwardMessagesPresenter(
|
||||
private fun TestScope.aForwardMessagesPresenter(
|
||||
eventId: EventId = AN_EVENT_ID,
|
||||
fakeRoom: FakeJoinedRoom = FakeJoinedRoom(),
|
||||
coroutineScope: CoroutineScope = this,
|
||||
) = ForwardMessagesPresenter(
|
||||
eventId = eventId.value,
|
||||
timelineProvider = LiveTimelineProvider(fakeRoom),
|
||||
appCoroutineScope = coroutineScope,
|
||||
appCoroutineScope = this,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ import io.element.android.libraries.matrix.test.A_USER_ID
|
|||
import io.element.android.libraries.matrix.test.A_USER_ID_2
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID_3
|
||||
import io.element.android.libraries.matrix.test.A_USER_ID_4
|
||||
import io.element.android.libraries.matrix.test.media.FakeMediaUploadHandler
|
||||
import io.element.android.libraries.matrix.test.permalink.FakePermalinkBuilder
|
||||
import io.element.android.libraries.matrix.test.permalink.FakePermalinkParser
|
||||
import io.element.android.libraries.matrix.test.room.FakeBaseRoom
|
||||
|
|
@ -101,8 +102,8 @@ import io.element.android.tests.testutils.waitForPredicate
|
|||
import io.mockk.mockk
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import kotlinx.coroutines.test.advanceUntilIdle
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Rule
|
||||
|
|
@ -132,7 +133,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - initial state`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -147,7 +148,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - toggle fullscreen`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -163,7 +164,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - change message`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -186,7 +187,6 @@ class MessageComposerPresenterTest {
|
|||
this.saveDraftLambda = updateDraftLambda
|
||||
}
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
draftService = draftService,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -229,7 +229,6 @@ class MessageComposerPresenterTest {
|
|||
this.saveDraftLambda = updateDraftLambda
|
||||
}
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
draftService = draftService,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -273,7 +272,6 @@ class MessageComposerPresenterTest {
|
|||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = joinedRoom,
|
||||
isRichTextEditorEnabled = false,
|
||||
)
|
||||
|
|
@ -314,7 +312,6 @@ class MessageComposerPresenterTest {
|
|||
this.saveDraftLambda = updateDraftLambda
|
||||
}
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
draftService = draftService,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -346,7 +343,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - change mode to reply`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -362,7 +359,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - cancel reply`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -382,7 +379,6 @@ class MessageComposerPresenterTest {
|
|||
@Test
|
||||
fun `present - send message with rich text enabled`() = runTest {
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = FakeJoinedRoom(
|
||||
liveTimeline = FakeTimeline().apply {
|
||||
sendMessageLambda = { _, _, _ -> Result.success(Unit) }
|
||||
|
|
@ -417,7 +413,6 @@ class MessageComposerPresenterTest {
|
|||
fun `present - send message with plain text enabled`() = runTest {
|
||||
val permalinkBuilder = FakePermalinkBuilder(permalinkForUserLambda = { Result.success("") })
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
isRichTextEditorEnabled = false,
|
||||
room = FakeJoinedRoom(
|
||||
liveTimeline = FakeTimeline().apply {
|
||||
|
|
@ -464,7 +459,6 @@ class MessageComposerPresenterTest {
|
|||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
this,
|
||||
joinedRoom,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -520,7 +514,6 @@ class MessageComposerPresenterTest {
|
|||
editMessageLambda = roomEditMessageLambda,
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
this,
|
||||
joinedRoom,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -576,7 +569,6 @@ class MessageComposerPresenterTest {
|
|||
typingNoticeResult = { Result.success(Unit) },
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
this,
|
||||
joinedRoom,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -628,7 +620,6 @@ class MessageComposerPresenterTest {
|
|||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
this,
|
||||
joinedRoom,
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
|
|
@ -666,7 +657,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - Open attachments menu`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -679,7 +670,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - Dismiss attachments menu`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -702,7 +693,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
navigator = navigator,
|
||||
)
|
||||
|
|
@ -743,7 +733,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
navigator = navigator,
|
||||
)
|
||||
|
|
@ -777,7 +766,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - Pick media from gallery & cancel does nothing`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
with(pickerProvider) {
|
||||
givenResult(null) // Simulate a user canceling the flow
|
||||
givenMimeType(MimeTypes.Images)
|
||||
|
|
@ -801,7 +790,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
navigator = navigator,
|
||||
)
|
||||
|
|
@ -819,7 +807,7 @@ class MessageComposerPresenterTest {
|
|||
val room = FakeJoinedRoom(
|
||||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(this, room = room)
|
||||
val presenter = createPresenter(room = room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -838,7 +826,7 @@ class MessageComposerPresenterTest {
|
|||
val room = FakeJoinedRoom(
|
||||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(this, room = room)
|
||||
val presenter = createPresenter(room = room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -863,7 +851,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
permissionPresenter = permissionPresenter,
|
||||
navigator = navigator,
|
||||
|
|
@ -888,7 +875,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
permissionPresenter = permissionPresenter,
|
||||
navigator = navigator,
|
||||
|
|
@ -915,7 +901,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
permissionPresenter = permissionPresenter,
|
||||
navigator = navigator,
|
||||
|
|
@ -940,7 +925,6 @@ class MessageComposerPresenterTest {
|
|||
onPreviewAttachmentLambda = onPreviewAttachmentLambda
|
||||
)
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
room = room,
|
||||
permissionPresenter = permissionPresenter,
|
||||
navigator = navigator,
|
||||
|
|
@ -961,7 +945,7 @@ class MessageComposerPresenterTest {
|
|||
@Test
|
||||
fun `present - errors are tracked`() = runTest {
|
||||
val testException = Exception("Test error")
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter()
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -973,7 +957,7 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - ToggleTextFormatting toggles text formatting`() = runTest {
|
||||
val presenter = createPresenter(this, isRichTextEditorEnabled = false)
|
||||
val presenter = createPresenter(isRichTextEditorEnabled = false)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1017,7 +1001,7 @@ class MessageComposerPresenterTest {
|
|||
)
|
||||
givenRoomInfo(aRoomInfo(isDirect = false))
|
||||
}
|
||||
val presenter = createPresenter(this, room)
|
||||
val presenter = createPresenter(room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1078,7 +1062,7 @@ class MessageComposerPresenterTest {
|
|||
)
|
||||
)
|
||||
}
|
||||
val presenter = createPresenter(this, room)
|
||||
val presenter = createPresenter(room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1094,7 +1078,6 @@ class MessageComposerPresenterTest {
|
|||
|
||||
fun `present - InsertSuggestion`() = runTest {
|
||||
val presenter = createPresenter(
|
||||
coroutineScope = this,
|
||||
permalinkBuilder = FakePermalinkBuilder(
|
||||
permalinkForUserLambda = {
|
||||
Result.success("https://matrix.to/#/${A_USER_ID_2.value}")
|
||||
|
|
@ -1134,7 +1117,7 @@ class MessageComposerPresenterTest {
|
|||
liveTimeline = timeline,
|
||||
typingNoticeResult = { Result.success(Unit) }
|
||||
)
|
||||
val presenter = createPresenter(room = room, coroutineScope = this)
|
||||
val presenter = createPresenter(room = room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1197,7 +1180,16 @@ class MessageComposerPresenterTest {
|
|||
|
||||
@Test
|
||||
fun `present - send uri`() = runTest {
|
||||
val presenter = createPresenter(this)
|
||||
val presenter = createPresenter(
|
||||
room = FakeJoinedRoom(
|
||||
typingNoticeResult = { Result.success(Unit) },
|
||||
liveTimeline = FakeTimeline().apply {
|
||||
sendFileLambda = { _, _, _, _, _, _ ->
|
||||
Result.success(FakeMediaUploadHandler())
|
||||
}
|
||||
}
|
||||
),
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
val state = presenter.present()
|
||||
remember(state, state.textEditorState.messageHtml()) { state }
|
||||
|
|
@ -1214,7 +1206,7 @@ class MessageComposerPresenterTest {
|
|||
val room = FakeJoinedRoom(
|
||||
typingNoticeResult = typingNoticeResult,
|
||||
)
|
||||
val presenter = createPresenter(room = room, coroutineScope = this)
|
||||
val presenter = createPresenter(room = room)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1240,7 +1232,7 @@ class MessageComposerPresenterTest {
|
|||
val store = InMemorySessionPreferencesStore(
|
||||
isSendTypingNotificationsEnabled = false
|
||||
)
|
||||
val presenter = createPresenter(room = room, sessionPreferencesStore = store, coroutineScope = this)
|
||||
val presenter = createPresenter(room = room, sessionPreferencesStore = store)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1258,7 +1250,7 @@ class MessageComposerPresenterTest {
|
|||
val composerDraftService = FakeComposerDraftService().apply {
|
||||
this.loadDraftLambda = loadDraftLambda
|
||||
}
|
||||
val presenter = createPresenter(draftService = composerDraftService, coroutineScope = this)
|
||||
val presenter = createPresenter(draftService = composerDraftService)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1283,7 +1275,6 @@ class MessageComposerPresenterTest {
|
|||
val presenter = createPresenter(
|
||||
draftService = composerDraftService,
|
||||
permalinkBuilder = permalinkBuilder,
|
||||
coroutineScope = this
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -1317,7 +1308,6 @@ class MessageComposerPresenterTest {
|
|||
val presenter = createPresenter(
|
||||
draftService = composerDraftService,
|
||||
permalinkBuilder = permalinkBuilder,
|
||||
coroutineScope = this
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -1351,7 +1341,6 @@ class MessageComposerPresenterTest {
|
|||
val presenter = createPresenter(
|
||||
draftService = composerDraftService,
|
||||
permalinkBuilder = permalinkBuilder,
|
||||
coroutineScope = this
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -1398,7 +1387,6 @@ class MessageComposerPresenterTest {
|
|||
room = room,
|
||||
draftService = composerDraftService,
|
||||
permalinkBuilder = permalinkBuilder,
|
||||
coroutineScope = this
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
|
|
@ -1428,7 +1416,7 @@ class MessageComposerPresenterTest {
|
|||
val composerDraftService = FakeComposerDraftService().apply {
|
||||
this.saveDraftLambda = saveDraftLambda
|
||||
}
|
||||
val presenter = createPresenter(draftService = composerDraftService, coroutineScope = this)
|
||||
val presenter = createPresenter(draftService = composerDraftService)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
presenter.present()
|
||||
}.test {
|
||||
|
|
@ -1452,7 +1440,6 @@ class MessageComposerPresenterTest {
|
|||
isRichTextEditorEnabled = false,
|
||||
draftService = composerDraftService,
|
||||
permalinkBuilder = permalinkBuilder,
|
||||
coroutineScope = this
|
||||
)
|
||||
moleculeFlow(RecompositionMode.Immediate) {
|
||||
val state = presenter.present()
|
||||
|
|
@ -1528,18 +1515,17 @@ class MessageComposerPresenterTest {
|
|||
return normalState
|
||||
}
|
||||
|
||||
private fun createPresenter(
|
||||
coroutineScope: CoroutineScope,
|
||||
private fun TestScope.createPresenter(
|
||||
room: JoinedRoom = FakeJoinedRoom(
|
||||
typingNoticeResult = { Result.success(Unit) }
|
||||
),
|
||||
navigator: MessagesNavigator = FakeMessagesNavigator(),
|
||||
pickerProvider: PickerProvider = this.pickerProvider,
|
||||
featureFlagService: FeatureFlagService = this.featureFlagService,
|
||||
pickerProvider: PickerProvider = this@MessageComposerPresenterTest.pickerProvider,
|
||||
featureFlagService: FeatureFlagService = this@MessageComposerPresenterTest.featureFlagService,
|
||||
locationService: LocationService = FakeLocationService(true),
|
||||
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
||||
mediaPreProcessor: MediaPreProcessor = this.mediaPreProcessor,
|
||||
snackbarDispatcher: SnackbarDispatcher = this.snackbarDispatcher,
|
||||
mediaPreProcessor: MediaPreProcessor = this@MessageComposerPresenterTest.mediaPreProcessor,
|
||||
snackbarDispatcher: SnackbarDispatcher = this@MessageComposerPresenterTest.snackbarDispatcher,
|
||||
permissionPresenter: PermissionsPresenter = FakePermissionsPresenter(),
|
||||
permalinkBuilder: PermalinkBuilder = FakePermalinkBuilder(),
|
||||
permalinkParser: PermalinkParser = FakePermalinkParser(),
|
||||
|
|
@ -1553,7 +1539,7 @@ class MessageComposerPresenterTest {
|
|||
draftService: ComposerDraftService = FakeComposerDraftService(),
|
||||
) = MessageComposerPresenter(
|
||||
navigator = navigator,
|
||||
appCoroutineScope = coroutineScope,
|
||||
appCoroutineScope = this,
|
||||
room = room,
|
||||
mediaPickerProvider = pickerProvider,
|
||||
featureFlagService = featureFlagService,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue