From fc788aed73c640e0dcecf92188115ac614d0409a Mon Sep 17 00:00:00 2001 From: yostyle Date: Mon, 18 Dec 2023 14:33:42 +0100 Subject: [PATCH] Add stringarray provider in vectorfeature --- towncrier.toml | 2 +- vector-app/build.gradle | 4 ++-- .../java/im/vector/app/ui/robot/NewRoomRobot.kt | 3 ++- .../java/im/vector/app/ui/robot/OnboardingRobot.kt | 8 +++++--- .../java/im/vector/app/ui/robot/space/SpaceRobot.kt | 3 ++- .../app/features/voice/VoiceRecorderProviderTests.kt | 9 ++++++++- .../java/im/vector/app/test/fakes/FakeVectorFeatures.kt | 2 +- 7 files changed, 21 insertions(+), 10 deletions(-) diff --git a/towncrier.toml b/towncrier.toml index aeae552313..fe681993ab 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] - version = "2.9.7" + version = "2.10.0" directory = "changelog.d" filename = "TCHAP_CHANGES.md" name = "Changes in Tchap" diff --git a/vector-app/build.gradle b/vector-app/build.gradle index 564284db0e..72eef653a8 100644 --- a/vector-app/build.gradle +++ b/vector-app/build.gradle @@ -33,11 +33,11 @@ knit { // Note: 2 digits max for each value ext.versionMajor = 2 -ext.versionMinor = 9 +ext.versionMinor = 10 // Note: even values are reserved for regular release, odd values for hotfix release. // When creating a hotfix, you should decrease the value, since the current value // is the value for the next regular release. -ext.versionPatch = 7 +ext.versionPatch = 0 static def getGitTimestamp() { def cmd = 'git show -s --format=%ct' diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt index 177feb9005..f433bcc199 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/NewRoomRobot.kt @@ -22,6 +22,7 @@ import androidx.test.platform.app.InstrumentationRegistry import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn import im.vector.app.R import im.vector.app.core.resources.BooleanProvider +import im.vector.app.core.resources.StringArrayProvider import im.vector.app.espresso.tools.waitUntilViewVisible import im.vector.app.features.DefaultVectorFeatures import im.vector.app.features.VectorFeatures @@ -32,7 +33,7 @@ class NewRoomRobot( private val labsPreferences: LabFeaturesPreferences ) { private val context = InstrumentationRegistry.getInstrumentation().targetContext - private val features: VectorFeatures = DefaultVectorFeatures(BooleanProvider(context.resources)) + private val features: VectorFeatures = DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources)) fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) { clickOn(R.string.create_new_room) diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt index 81638928a9..8b2705465c 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/OnboardingRobot.kt @@ -30,6 +30,7 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo import im.vector.app.R import im.vector.app.core.resources.BooleanProvider +import im.vector.app.core.resources.StringArrayProvider import im.vector.app.espresso.tools.waitUntilViewVisible import im.vector.app.features.DefaultVectorFeatures import im.vector.app.features.debug.features.DebugFeatureKeys @@ -40,9 +41,10 @@ class OnboardingRobot { // Tchap: Override default feature values for tests private val context = InstrumentationRegistry.getInstrumentation().targetContext - private val defaultVectorFeatures = DebugVectorFeatures(context, DefaultVectorFeatures(BooleanProvider(context.resources))).apply { - override(true, DebugFeatureKeys.tchapIsKeyBackupEnabled) - } + private val defaultVectorFeatures = + DebugVectorFeatures(context, DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources))).apply { + override(true, DebugFeatureKeys.tchapIsKeyBackupEnabled) + } fun crawl() { waitUntilViewVisible(withId(R.id.loginSplashSubmit)) diff --git a/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt b/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt index a067b7d348..6d560cffb7 100644 --- a/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt +++ b/vector-app/src/androidTest/java/im/vector/app/ui/robot/space/SpaceRobot.kt @@ -28,6 +28,7 @@ import com.adevinta.android.barista.interaction.BaristaDrawerInteractions.openDr import com.adevinta.android.barista.internal.viewaction.ClickChildAction import im.vector.app.R import im.vector.app.core.resources.BooleanProvider +import im.vector.app.core.resources.StringArrayProvider import im.vector.app.espresso.tools.waitUntilDialogVisible import im.vector.app.espresso.tools.waitUntilViewVisible import im.vector.app.features.DefaultVectorFeatures @@ -37,7 +38,7 @@ import org.hamcrest.Matchers class SpaceRobot(private val labsPreferences: LabFeaturesPreferences) { private val context = InstrumentationRegistry.getInstrumentation().targetContext - private val features: VectorFeatures = DefaultVectorFeatures(BooleanProvider(context.resources)) + private val features: VectorFeatures = DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources)) fun createSpace(isFirstSpace: Boolean, block: SpaceCreateRobot.() -> Unit) { if (labsPreferences.isNewAppLayoutEnabled) { diff --git a/vector/src/androidTest/java/im/vector/app/features/voice/VoiceRecorderProviderTests.kt b/vector/src/androidTest/java/im/vector/app/features/voice/VoiceRecorderProviderTests.kt index c531c7b8da..12a3a9b8aa 100644 --- a/vector/src/androidTest/java/im/vector/app/features/voice/VoiceRecorderProviderTests.kt +++ b/vector/src/androidTest/java/im/vector/app/features/voice/VoiceRecorderProviderTests.kt @@ -20,6 +20,7 @@ import android.os.Build import androidx.test.platform.app.InstrumentationRegistry import im.vector.app.TestBuildVersionSdkIntProvider import im.vector.app.core.resources.BooleanProvider +import im.vector.app.core.resources.StringArrayProvider import im.vector.app.features.DefaultVectorFeatures import io.mockk.every import io.mockk.spyk @@ -30,7 +31,13 @@ class VoiceRecorderProviderTests { private val context = InstrumentationRegistry.getInstrumentation().targetContext private val buildVersionSdkIntProvider = TestBuildVersionSdkIntProvider() - private val provider = spyk(VoiceRecorderProvider(context, DefaultVectorFeatures(BooleanProvider(context.resources)), buildVersionSdkIntProvider)) + private val provider = spyk( + VoiceRecorderProvider( + context, + DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources)), + buildVersionSdkIntProvider + ) + ) @Test fun provideVoiceRecorderOnAndroidQAndCodecReturnsQRecorder() { diff --git a/vector/src/test/java/im/vector/app/test/fakes/FakeVectorFeatures.kt b/vector/src/test/java/im/vector/app/test/fakes/FakeVectorFeatures.kt index 43230b7dd3..4c5d296ab5 100644 --- a/vector/src/test/java/im/vector/app/test/fakes/FakeVectorFeatures.kt +++ b/vector/src/test/java/im/vector/app/test/fakes/FakeVectorFeatures.kt @@ -22,7 +22,7 @@ import io.mockk.every import io.mockk.mockk import io.mockk.spyk -class FakeVectorFeatures : VectorFeatures by spyk(DefaultVectorFeatures(mockk())) { +class FakeVectorFeatures : VectorFeatures by spyk(DefaultVectorFeatures(mockk(), mockk())) { fun givenPersonalisationEnabled() { every { isOnboardingPersonalizeEnabled() } returns true