diff --git a/app/src/androidTest/kotlin/org/libremail/ui/compose/ComposeScreenTest.kt b/app/src/androidTest/kotlin/org/libremail/ui/compose/ComposeScreenTest.kt index 662f1a8..bc014dd 100644 --- a/app/src/androidTest/kotlin/org/libremail/ui/compose/ComposeScreenTest.kt +++ b/app/src/androidTest/kotlin/org/libremail/ui/compose/ComposeScreenTest.kt @@ -3,6 +3,7 @@ package org.libremail.ui.compose import android.Manifest import androidx.activity.ComponentActivity +import androidx.compose.ui.semantics.SemanticsActions import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.assertIsEnabled import androidx.compose.ui.test.assertIsNotEnabled @@ -169,6 +170,59 @@ class ComposeScreenTest { assertEquals("bcc@example.com", sent.bcc) } + @Test + fun formattingToolbar_bulletButtonMarksTheLineAndSendsItAsHtml() { + val mailRepository = FakeMailRepository() + setContent(mailRepository) + + composeTestRule.onNodeWithText(string(R.string.compose_to)).performTextInput("you@example.com") + composeTestRule.onNodeWithText(string(R.string.compose_body)).performTextInput("Buy milk") + // The bullet-list button is deliberately chosen over the inline styles (bold/italic): block + // markers apply to the caret's whole line, so the end-of-text caret that performTextInput + // leaves is enough - no on-device range selection (which is unreliable in instrumented tests) + // is needed to prove that a toolbar tap flows real formatting into the sent message's HTML. + // "•" is the bullet button's own (untranslated) glyph label - see FormattingToolbar. + composeTestRule.onNodeWithText("•").performClick() + composeTestRule.onNodeWithContentDescription(string(R.string.action_send)).performClick() + + composeTestRule.waitUntil(timeoutMillis = 5_000) { mailRepository.sentMessages.isNotEmpty() } + val sent = mailRepository.sentMessages.single() + // Plaintext keeps the readable "• " marker; the HTML part carries the real