Merge pull request #3044 from element-hq/feature/bma/testDefaultClearCacheUseCase
Add test on DefaultClearCacheUseCase
This commit is contained in:
commit
038b60a271
12 changed files with 245 additions and 22 deletions
|
|
@ -84,6 +84,7 @@ dependencies {
|
|||
testImplementation(projects.services.analytics.test)
|
||||
testImplementation(projects.services.toolbox.test)
|
||||
testImplementation(projects.features.networkmonitor.test)
|
||||
testImplementation(projects.features.roomlist.test)
|
||||
testImplementation(projects.tests.testutils)
|
||||
testImplementation(projects.features.leaveroom.test)
|
||||
}
|
||||
|
|
|
|||
28
features/roomlist/test/build.gradle.kts
Normal file
28
features/roomlist/test/build.gradle.kts
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2024 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
plugins {
|
||||
id("io.element.android-library")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.features.roomlist.test"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.features.roomlist.api)
|
||||
implementation(projects.libraries.matrix.api)
|
||||
implementation(projects.tests.testutils)
|
||||
}
|
||||
|
|
@ -19,7 +19,9 @@ package io.element.android.features.roomlist.impl.migration
|
|||
import io.element.android.features.roomlist.api.migration.MigrationScreenStore
|
||||
import io.element.android.libraries.matrix.api.core.SessionId
|
||||
|
||||
class InMemoryMigrationScreenStore : MigrationScreenStore {
|
||||
class InMemoryMigrationScreenStore(
|
||||
private val resetLambda: () -> Unit = { }
|
||||
) : MigrationScreenStore {
|
||||
private val store = mutableMapOf<SessionId, Boolean>()
|
||||
|
||||
override fun isMigrationScreenNeeded(sessionId: SessionId): Boolean {
|
||||
|
|
@ -33,5 +35,6 @@ class InMemoryMigrationScreenStore : MigrationScreenStore {
|
|||
|
||||
override fun reset() {
|
||||
store.clear()
|
||||
resetLambda()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue