Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 0921d1f0 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

test: remove outdated checkKoinModules from AccountSettingsModuleKtTest

parent 3a376d2c
Loading
Loading
Loading
Loading
+2 −33
Original line number Diff line number Diff line
package net.thunderbird.feature.account.settings.impl

import kotlin.test.Test
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import net.thunderbird.feature.account.api.AccountId
import net.thunderbird.feature.account.api.profile.AccountProfile
import net.thunderbird.feature.account.api.profile.AccountProfileRepository
import net.thunderbird.feature.account.settings.featureAccountSettingsModule
import net.thunderbird.feature.account.settings.impl.ui.general.GeneralSettingsContract
import net.thunderbird.feature.account.settings.impl.ui.general.GeneralSettingsViewModel
import org.junit.runner.RunWith
import org.koin.android.ext.koin.androidContext
import org.koin.core.annotation.KoinExperimentalAPI
import org.koin.core.module.Module
import org.koin.dsl.module
import org.koin.test.AutoCloseKoinTest
import org.koin.test.check.checkKoinModules
import org.koin.test.verify.verify
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment

@OptIn(KoinExperimentalAPI::class)
@RunWith(RobolectricTestRunner::class)
internal class AccountSettingsModuleKtTest : AutoCloseKoinTest() {

    private val externalModule: Module = module {
        single<AccountProfileRepository> {
            object : AccountProfileRepository {
                override fun getById(accountId: AccountId): Flow<AccountProfile?> = flow { null }

                override suspend fun update(accountProfile: AccountProfile) = Unit
            }
        }
    }
internal class AccountSettingsModuleKtTest {

    @OptIn(KoinExperimentalAPI::class)
    @Test
    fun `should hava a valid di module`() {
        featureAccountSettingsModule.verify(
@@ -42,12 +18,5 @@ internal class AccountSettingsModuleKtTest : AutoCloseKoinTest() {
                GeneralSettingsContract.State::class,
            ),
        )

        checkKoinModules(
            modules = listOf(externalModule, featureAccountSettingsModule),
            appDeclaration = { androidContext(RuntimeEnvironment.getApplication()) },
        ) {
            withParameter<GeneralSettingsViewModel> { AccountId.create() }
        }
    }
}