diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 855f3ee..c570043 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -30,6 +30,7 @@ jobs: autoupdate: name: Auto-update armed PRs runs-on: ubuntu-latest + environment: CI_CD steps: - name: Update behind PRs that have auto-merge enabled uses: chinthakagodawita/autoupdate@0707656cd062a3b0cf8fa9b2cda1d1404d74437e # v1.7.0 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4f62af4..5c0e84e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -227,6 +227,7 @@ dependencies { androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.espresso.intents) + androidTestImplementation(libs.androidx.test.rules) androidTestImplementation(platform(libs.androidx.compose.bom)) androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.room.testing) 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 37e746b..13e83f4 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 @@ -171,6 +172,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