Skip to content

Commit

Permalink
Add stringarray provider in vectorfeature
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Dec 18, 2023
1 parent 8e64452 commit fc788ae
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc788ae

Please sign in to comment.