From 6337d4e617dbf497b24420cc4a96c783297e717b Mon Sep 17 00:00:00 2001 From: Ricky Hu Date: Sat, 14 Sep 2024 16:55:07 +0800 Subject: [PATCH] Bump release version to 0.4.0 (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: 💍 modify typo for tests * chore: 🤖 update version code and version name * test: 💍 add missing tests * test: 💍 modify test typo --- app/build.gradle.kts | 4 ++-- .../hushkeyboard/introduction/Step1Section.kt | 4 ++-- .../rickyhu/hushkeyboard/ui/HomeScreenUiTest.kt | 14 ++++++++++++++ .../hushkeyboard/ui/IntroductionScreenUiTest.kt | 6 +++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 97bfa3e..b133da4 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -16,8 +16,8 @@ android { applicationId = "com.rickyhu.hushkeyboard" minSdk = 26 targetSdk = 34 - versionCode = 2 - versionName = "0.3.0" + versionCode = 3 + versionName = "0.4.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/com/rickyhu/hushkeyboard/introduction/Step1Section.kt b/app/src/main/java/com/rickyhu/hushkeyboard/introduction/Step1Section.kt index 2df592b..624e939 100644 --- a/app/src/main/java/com/rickyhu/hushkeyboard/introduction/Step1Section.kt +++ b/app/src/main/java/com/rickyhu/hushkeyboard/introduction/Step1Section.kt @@ -44,7 +44,7 @@ fun Step1Section( onClick = onSectionButtonClicked, modifier = Modifier .fillMaxWidth() - .testTag("SetupKeyboardButtonOutlined") + .testTag("EnableKeyboardButtonOutlined") ) { Text(text = stringResource(R.string.intro_enable_keyboard_button)) } @@ -53,7 +53,7 @@ fun Step1Section( onClick = onSectionButtonClicked, modifier = Modifier .fillMaxWidth() - .testTag("SetupKeyboardButtonFilled") + .testTag("EnableKeyboardButtonFilled") ) { Text(text = stringResource(R.string.intro_enable_keyboard_button)) } diff --git a/app/src/test/java/com/rickyhu/hushkeyboard/ui/HomeScreenUiTest.kt b/app/src/test/java/com/rickyhu/hushkeyboard/ui/HomeScreenUiTest.kt index bef5441..9833280 100644 --- a/app/src/test/java/com/rickyhu/hushkeyboard/ui/HomeScreenUiTest.kt +++ b/app/src/test/java/com/rickyhu/hushkeyboard/ui/HomeScreenUiTest.kt @@ -6,6 +6,7 @@ import androidx.compose.ui.test.assertIsEnabled import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick +import androidx.compose.ui.test.performTextInput import com.rickyhu.hushkeyboard.home.HomeScreen import org.junit.Assert.assertTrue import org.junit.Before @@ -69,4 +70,17 @@ class HomeScreenUiTest { assertTrue(isSettingsButtonClicked) } + + @Test + fun `The textField should be displayed and should be enabled to enter text`() { + composeTestRule + .onNodeWithText("Type here") + .assertExists() + .assertIsEnabled() + .performTextInput("Test input") + + composeTestRule + .onNodeWithText("Test input") + .assertExists() + } } diff --git a/app/src/test/java/com/rickyhu/hushkeyboard/ui/IntroductionScreenUiTest.kt b/app/src/test/java/com/rickyhu/hushkeyboard/ui/IntroductionScreenUiTest.kt index 16314d7..e42b208 100644 --- a/app/src/test/java/com/rickyhu/hushkeyboard/ui/IntroductionScreenUiTest.kt +++ b/app/src/test/java/com/rickyhu/hushkeyboard/ui/IntroductionScreenUiTest.kt @@ -36,7 +36,7 @@ class IntroductionScreenUiTest { } composeTestRule - .onNodeWithTag("SetupKeyboardButtonFilled") + .onNodeWithTag("EnableKeyboardButtonFilled") .assertExists() .assertIsEnabled() .assertHasClickAction() @@ -52,7 +52,7 @@ class IntroductionScreenUiTest { } composeTestRule - .onNodeWithTag("SetupKeyboardButtonOutlined") + .onNodeWithTag("EnableKeyboardButtonOutlined") .assertExists() .assertIsEnabled() .assertHasClickAction() @@ -70,7 +70,7 @@ class IntroductionScreenUiTest { } composeTestRule - .onNodeWithTag("SetupKeyboardButtonFilled") + .onNodeWithTag("EnableKeyboardButtonFilled") .performClick() assertTrue(isEnableKeyboardButtonClicked)