Updated on 2026-08-14
This commit is contained in:
parent
0b81b905c3
commit
50332186fa
47 changed files with 38 additions and 408 deletions
|
|
@ -194,21 +194,10 @@ abstract class BaseTestCase : TestCase(
|
|||
"SWAP_REDESIGN_ENABLED" to false,
|
||||
"ACCOUNTS_FEATURE_ENABLED" to true,
|
||||
"MAIN_SCREEN_QR_SCANNING_ENABLED" to true,
|
||||
"ASSETS_DISCOVERY_ENABLED" to true,
|
||||
"VISA_ONBOARDING_ENABLED" to true,
|
||||
// Version-gated toggles released in versions <= 6.0 — forced on so tests run against the actual
|
||||
// build even when the app version resolves to 1.0.0-SNAPSHOT on CI (then 1.0.0 < x.xx would
|
||||
// disable them). On the releases/6.0 branch every toggle with version <= 6.0 ships enabled.
|
||||
// 5.37
|
||||
"HEDERA_ERC20_ENABLED" to true,
|
||||
// 5.39
|
||||
"DYNAMIC_ADDRESSES_ENABLED" to true,
|
||||
"SOLANA_TX_HISTORY_ENABLED" to true,
|
||||
"SOLANA_SCALED_UI_AMOUNT_ENABLED" to true,
|
||||
"AND_15310_ADD_FUNDS_STAGE1" to true,
|
||||
"AND_15101_TANGEM_PAY_HOT_WALLET_ONBOARDING" to true,
|
||||
"AND_15402_ADI_MAIN_SCREEN_DEFAULT_ENABLED" to true,
|
||||
"TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED" to true,
|
||||
// 5.40
|
||||
"TWI_1377_MANAGE_FUNDS" to true,
|
||||
// 6.0
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@ package com.tangem.tap.common.analytics.appsflyer
|
|||
|
||||
import com.tangem.common.routing.AppRoute
|
||||
import com.tangem.common.routing.AppRouter
|
||||
import com.tangem.core.configtoggle.FeatureToggles
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.datasource.local.appsflyer.AppsFlyerStore
|
||||
import com.tangem.domain.appsflyer.AppsFlyerDeeplink
|
||||
import com.tangem.domain.appsflyer.usecase.ClearAppsFlyerDeeplinkUseCase
|
||||
|
|
@ -29,7 +27,6 @@ class AppsFlyerDeeplinkRouter @Inject constructor(
|
|||
private val appsFlyerStore: AppsFlyerStore,
|
||||
private val userWalletsListRepository: UserWalletsListRepository,
|
||||
private val clearAppsFlyerDeeplinkUseCase: ClearAppsFlyerDeeplinkUseCase,
|
||||
private val featureTogglesManager: FeatureTogglesManager,
|
||||
private val appRouter: AppRouter,
|
||||
) {
|
||||
|
||||
|
|
@ -54,11 +51,6 @@ class AppsFlyerDeeplinkRouter @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun routeTangemPayOnboarding(currentRoute: AppRoute) {
|
||||
val isEnabled = featureTogglesManager.isFeatureEnabled(
|
||||
FeatureToggles.AND_15101_TANGEM_PAY_HOT_WALLET_ONBOARDING,
|
||||
)
|
||||
if (!isEnabled) return
|
||||
|
||||
// Not on an idle entry screen yet: keep the deep link pending, re-evaluate on next route change.
|
||||
if (!isIdleEntryPoint(currentRoute)) return
|
||||
|
||||
|
|
@ -76,11 +68,6 @@ class AppsFlyerDeeplinkRouter @Inject constructor(
|
|||
}
|
||||
|
||||
private suspend fun routeReferral(currentRoute: AppRoute) {
|
||||
val isEnabled = featureTogglesManager.isFeatureEnabled(
|
||||
FeatureToggles.TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED,
|
||||
)
|
||||
if (!isEnabled) return
|
||||
|
||||
// Referral targets fresh installs: from an idle entry screen, go straight to hot wallet creation
|
||||
// (skips stories). The deep link is NOT cleared here — it stays as referral attribution (read by
|
||||
// IsReferralInstallUseCase, cleared on wallet creation); replaceAll keeps it off the back stack.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.tangem.tap.di.domain
|
||||
|
||||
import com.tangem.domain.dynamicaddresses.CreateConsolidationTransactionUseCase
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.dynamicaddresses.EnableDynamicAddressesUseCase
|
||||
import com.tangem.domain.dynamicaddresses.GetDynamicAddressesStatusUseCase
|
||||
import com.tangem.domain.dynamicaddresses.GetDynamicReceiveAddressUseCase
|
||||
|
|
@ -71,10 +70,8 @@ internal object DynamicAddressesDomainModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideIsDynamicAddressesAvailableUseCase(
|
||||
featureToggles: DynamicAddressesFeatureToggles,
|
||||
): IsDynamicAddressesAvailableUseCase {
|
||||
return IsDynamicAddressesAvailableUseCase(featureToggles)
|
||||
fun provideIsDynamicAddressesAvailableUseCase(): IsDynamicAddressesAvailableUseCase {
|
||||
return IsDynamicAddressesAvailableUseCase()
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.tangem.domain.common.wallets.UserWalletsListRepository
|
|||
import com.tangem.domain.demo.models.DemoConfig
|
||||
import com.tangem.core.configtoggle.FeatureToggles
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.domain.dynamicaddresses.DynamicAddressesFeatureToggles
|
||||
import com.tangem.domain.dynamicaddresses.GetDynamicReceiveAddressUseCase
|
||||
import com.tangem.domain.dynamicaddresses.repository.DynamicAddressesRepository
|
||||
import com.tangem.domain.transaction.GaslessYieldRepository
|
||||
|
|
@ -287,7 +286,6 @@ internal object TransactionDomainModule {
|
|||
getViewedTokenReceiveWarningUseCase: GetViewedTokenReceiveWarningUseCase,
|
||||
getDynamicReceiveAddressUseCase: GetDynamicReceiveAddressUseCase,
|
||||
dynamicAddressesRepository: DynamicAddressesRepository,
|
||||
dynamicAddressesFeatureToggles: DynamicAddressesFeatureToggles,
|
||||
userWalletsListRepository: UserWalletsListRepository,
|
||||
): ReceiveAddressesFactory {
|
||||
return ReceiveAddressesFactory(
|
||||
|
|
@ -295,7 +293,6 @@ internal object TransactionDomainModule {
|
|||
getViewedTokenReceiveWarningUseCase = getViewedTokenReceiveWarningUseCase,
|
||||
getDynamicReceiveAddressUseCase = getDynamicReceiveAddressUseCase,
|
||||
dynamicAddressesRepository = dynamicAddressesRepository,
|
||||
dynamicAddressesFeatureToggles = dynamicAddressesFeatureToggles,
|
||||
userWalletsListRepository = userWalletsListRepository,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.tangem.tap.common.analytics.appsflyer
|
|||
import com.google.common.truth.Truth.assertThat
|
||||
import com.tangem.common.routing.AppRoute
|
||||
import com.tangem.common.routing.AppRouter
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.datasource.local.appsflyer.AppsFlyerStore
|
||||
import com.tangem.domain.appsflyer.usecase.ClearAppsFlyerDeeplinkUseCase
|
||||
import com.tangem.domain.common.wallets.UserWalletsListRepository
|
||||
|
|
@ -33,14 +32,12 @@ internal class AppsFlyerDeeplinkRouterTest {
|
|||
private val appsFlyerStore: AppsFlyerStore = mockk()
|
||||
private val userWalletsListRepository: UserWalletsListRepository = mockk()
|
||||
private val clearAppsFlyerDeeplinkUseCase: ClearAppsFlyerDeeplinkUseCase = mockk(relaxed = true)
|
||||
private val featureTogglesManager: FeatureTogglesManager = mockk()
|
||||
private val appRouter: AppRouter = mockk(relaxed = true)
|
||||
|
||||
private val router = AppsFlyerDeeplinkRouter(
|
||||
appsFlyerStore = appsFlyerStore,
|
||||
userWalletsListRepository = userWalletsListRepository,
|
||||
clearAppsFlyerDeeplinkUseCase = clearAppsFlyerDeeplinkUseCase,
|
||||
featureTogglesManager = featureTogglesManager,
|
||||
appRouter = appRouter,
|
||||
)
|
||||
|
||||
|
|
@ -50,11 +47,9 @@ internal class AppsFlyerDeeplinkRouterTest {
|
|||
appsFlyerStore,
|
||||
userWalletsListRepository,
|
||||
clearAppsFlyerDeeplinkUseCase,
|
||||
featureTogglesManager,
|
||||
appRouter,
|
||||
)
|
||||
// Happy baseline: feature on, deep link pending, authorized.
|
||||
every { featureTogglesManager.isFeatureEnabled(any()) } returns true
|
||||
// Happy baseline: deep link pending, authorized.
|
||||
every { appsFlyerStore.observeNavigationDeeplink() } returns flowOf("tpay_mobileonboard")
|
||||
coEvery { userWalletsListRepository.userWalletsSync() } returns listOf(mockk<UserWallet>())
|
||||
}
|
||||
|
|
@ -161,20 +156,5 @@ internal class AppsFlyerDeeplinkRouterTest {
|
|||
verify(exactly = 0) { appRouter.push(any(), any()) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `GIVEN feature disabled WHEN observe THEN does not navigate`() = runTest(UnconfinedTestDispatcher()) {
|
||||
// Arrange
|
||||
every { featureTogglesManager.isFeatureEnabled(any()) } returns false
|
||||
val currentRoute = MutableStateFlow<AppRoute?>(AppRoute.Wallet)
|
||||
|
||||
// Act
|
||||
router.observe(backgroundScope, currentRoute)
|
||||
advanceUntilIdle()
|
||||
|
||||
// Assert
|
||||
coVerify(exactly = 0) { userWalletsListRepository.userWalletsSync() }
|
||||
verify(exactly = 0) { appRouter.push(any(), any()) }
|
||||
}
|
||||
|
||||
// endregion
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue