Updated on 2026-08-14
This commit is contained in:
parent
7b4ae4e23d
commit
61ad9e7bb4
14 changed files with 7 additions and 116 deletions
|
|
@ -207,8 +207,6 @@ abstract class BaseTestCase : TestCase(
|
|||
"AND_15103_SWAP_RATE_EXPERIENCE_ENABLED" to true,
|
||||
"AND_15122_SWAP_PREDEFINED_BUTTONS_ENABLED" to true,
|
||||
"TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED" to true,
|
||||
// 5.39.2
|
||||
"AND_15154_YIELD_PROMO_ENABLED" to true,
|
||||
// 5.40
|
||||
"TWI_1377_MANAGE_FUNDS" to true,
|
||||
// 6.0
|
||||
|
|
|
|||
|
|
@ -115,10 +115,6 @@
|
|||
"name": "AND_15122_SWAP_PREDEFINED_BUTTONS_ENABLED",
|
||||
"version": "5.39"
|
||||
},
|
||||
{
|
||||
"name": "AND_15154_YIELD_PROMO_ENABLED",
|
||||
"version": "5.39.2"
|
||||
},
|
||||
{
|
||||
"name": "TWI_1512_HIDE_STORIES_FOR_REFERRAL_ENABLED",
|
||||
"version": "5.39"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ import com.tangem.feature.wallet.presentation.account.AccountDependencies
|
|||
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotification
|
||||
import com.tangem.features.hotwallet.HotWalletFeatureToggles
|
||||
import com.tangem.features.wallet.featuretoggles.WalletFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.hot.sdk.model.HotWalletId
|
||||
import com.tangem.lib.crypto.BlockchainUtils
|
||||
import com.tangem.utils.annotations.RemoveWithToggle
|
||||
|
|
@ -70,7 +69,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
private val hotWalletFeatureToggles: HotWalletFeatureToggles,
|
||||
private val shouldShowYieldBoostMainBannerUseCase: ShouldShowYieldBoostMainBannerUseCase,
|
||||
private val yieldSupplyGetShouldShowMainPromoUseCase: YieldSupplyGetShouldShowMainPromoUseCase,
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles,
|
||||
private val designFeatureToggles: DesignFeatureToggles,
|
||||
private val walletFeatureToggles: WalletFeatureToggles,
|
||||
) {
|
||||
|
|
@ -208,7 +206,6 @@ internal class GetMultiWalletWarningsFactory @Inject constructor(
|
|||
clickIntents: WalletClickIntents,
|
||||
) {
|
||||
if (!shouldShowLocal) return
|
||||
if (!yieldSupplyFeatureToggles.isYieldPromoEnabled) return
|
||||
if (designFeatureToggles.isRedesignEnabled) return
|
||||
val shouldShow = shouldShowYieldBoostMainBannerUseCase(userWallet.walletId).getOrNull() == true
|
||||
if (!shouldShow) return
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import com.tangem.domain.yield.supply.promo.usecase.ShouldShowYieldBoostMainBann
|
|||
import com.tangem.domain.yield.supply.usecase.YieldSupplyGetShouldShowMainPromoUseCase
|
||||
import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
|
||||
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotificationUM
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.utils.extensions.addIf
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
|
|
@ -38,7 +37,6 @@ internal class GetWalletNotificationsCarouselFactory @Inject constructor(
|
|||
private val notificationsRepository: NotificationsRepository,
|
||||
private val shouldShowYieldBoostMainBannerUseCase: ShouldShowYieldBoostMainBannerUseCase,
|
||||
private val yieldSupplyGetShouldShowMainPromoUseCase: YieldSupplyGetShouldShowMainPromoUseCase,
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles,
|
||||
private val singleAccountStatusListSupplier: SingleAccountStatusListSupplier,
|
||||
) {
|
||||
fun create(userWallet: UserWallet, clickIntents: WalletClickIntents): Flow<ImmutableList<WalletNotificationUM>> {
|
||||
|
|
@ -86,7 +84,6 @@ internal class GetWalletNotificationsCarouselFactory @Inject constructor(
|
|||
clickIntents: WalletClickIntents,
|
||||
) {
|
||||
if (!shouldShowLocal) return
|
||||
if (!yieldSupplyFeatureToggles.isYieldPromoEnabled) return
|
||||
val shouldShow = shouldShowYieldBoostMainBannerUseCase(userWallet.walletId).getOrNull() == true
|
||||
if (!shouldShow) return
|
||||
add(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import com.tangem.domain.yield.supply.promo.usecase.ShouldShowYieldBoostMainBann
|
|||
import com.tangem.domain.yield.supply.usecase.YieldSupplyGetShouldShowMainPromoUseCase
|
||||
import com.tangem.feature.wallet.child.wallet.model.intents.WalletClickIntents
|
||||
import com.tangem.feature.wallet.presentation.wallet.state.model.WalletNotificationUM
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import io.mockk.clearMocks
|
||||
import io.mockk.coEvery
|
||||
import io.mockk.every
|
||||
|
|
@ -42,7 +41,6 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
private val notificationsRepository: NotificationsRepository = mockk()
|
||||
private val shouldShowYieldBoostMainBannerUseCase: ShouldShowYieldBoostMainBannerUseCase = mockk()
|
||||
private val yieldSupplyGetShouldShowMainPromoUseCase: YieldSupplyGetShouldShowMainPromoUseCase = mockk()
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles = mockk()
|
||||
private val singleAccountStatusListSupplier: SingleAccountStatusListSupplier = mockk(relaxed = true)
|
||||
private val clickIntents: WalletClickIntents = mockk(relaxed = true)
|
||||
private val userWallet: UserWallet.Hot = mockk(relaxed = true)
|
||||
|
|
@ -53,7 +51,6 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
notificationsRepository = notificationsRepository,
|
||||
shouldShowYieldBoostMainBannerUseCase = shouldShowYieldBoostMainBannerUseCase,
|
||||
yieldSupplyGetShouldShowMainPromoUseCase = yieldSupplyGetShouldShowMainPromoUseCase,
|
||||
yieldSupplyFeatureToggles = yieldSupplyFeatureToggles,
|
||||
singleAccountStatusListSupplier = singleAccountStatusListSupplier,
|
||||
)
|
||||
|
||||
|
|
@ -65,7 +62,6 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
notificationsRepository,
|
||||
shouldShowYieldBoostMainBannerUseCase,
|
||||
yieldSupplyGetShouldShowMainPromoUseCase,
|
||||
yieldSupplyFeatureToggles,
|
||||
singleAccountStatusListSupplier,
|
||||
clickIntents,
|
||||
userWallet,
|
||||
|
|
@ -77,7 +73,6 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
every { isReadyToShowRateAppUseCase() } returns flowOf(false)
|
||||
every { getWalletsUseCase() } returns flowOf(emptyList())
|
||||
every { yieldSupplyGetShouldShowMainPromoUseCase() } returns flowOf(true)
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns true
|
||||
coEvery { shouldShowYieldBoostMainBannerUseCase(any()) } returns Either.Right(true)
|
||||
// Balance is loaded by default, so banners gated on balance are not suppressed.
|
||||
every {
|
||||
|
|
@ -89,7 +84,6 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
@MethodSource("provideTestModels")
|
||||
fun `GIVEN gating conditions WHEN create THEN yield boost banner visibility matches`(model: Model) = runTest {
|
||||
// Arrange
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns model.toggleEnabled
|
||||
every { yieldSupplyGetShouldShowMainPromoUseCase() } returns flowOf(model.shouldShowLocal)
|
||||
coEvery { shouldShowYieldBoostMainBannerUseCase(WALLET_ID) } returns model.mainBanner
|
||||
|
||||
|
|
@ -145,19 +139,16 @@ internal class GetWalletNotificationsCarouselFactoryTest {
|
|||
)
|
||||
|
||||
internal data class Model(
|
||||
val toggleEnabled: Boolean,
|
||||
val shouldShowLocal: Boolean,
|
||||
val mainBanner: Either<Throwable, Boolean>,
|
||||
val expectedShown: Boolean,
|
||||
)
|
||||
|
||||
private fun provideTestModels() = listOf(
|
||||
Model(toggleEnabled = true, shouldShowLocal = true, mainBanner = Either.Right(true), expectedShown = true),
|
||||
Model(toggleEnabled = false, shouldShowLocal = true, mainBanner = Either.Right(true), expectedShown = false),
|
||||
Model(toggleEnabled = true, shouldShowLocal = false, mainBanner = Either.Right(true), expectedShown = false),
|
||||
Model(toggleEnabled = true, shouldShowLocal = true, mainBanner = Either.Right(false), expectedShown = false),
|
||||
Model(shouldShowLocal = true, mainBanner = Either.Right(true), expectedShown = true),
|
||||
Model(shouldShowLocal = false, mainBanner = Either.Right(true), expectedShown = false),
|
||||
Model(shouldShowLocal = true, mainBanner = Either.Right(false), expectedShown = false),
|
||||
Model(
|
||||
toggleEnabled = true,
|
||||
shouldShowLocal = true,
|
||||
mainBanner = Either.Left(RuntimeException("boom")),
|
||||
expectedShown = false,
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
package com.tangem.features.yield.supply.api
|
||||
|
||||
interface YieldSupplyFeatureToggles {
|
||||
val isYieldPromoEnabled: Boolean
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.tangem.features.yield.supply.impl
|
||||
|
||||
import com.tangem.core.configtoggle.FeatureToggles
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import javax.inject.Inject
|
||||
|
||||
internal class DefaultYieldSupplyFeatureToggles @Inject constructor(
|
||||
featureTogglesManager: FeatureTogglesManager,
|
||||
) : YieldSupplyFeatureToggles {
|
||||
|
||||
override val isYieldPromoEnabled: Boolean = featureTogglesManager.isFeatureEnabled(
|
||||
toggle = FeatureToggles.AND_15154_YIELD_PROMO_ENABLED,
|
||||
)
|
||||
}
|
||||
|
|
@ -33,7 +33,6 @@ import com.tangem.domain.yield.supply.models.YieldBoostStatus
|
|||
import com.tangem.domain.yield.supply.promo.usecase.GetYieldBoostStatusUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.*
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyActiveComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics
|
||||
import com.tangem.features.yield.supply.impl.R
|
||||
import com.tangem.core.res.R as CoreResR
|
||||
|
|
@ -72,7 +71,6 @@ internal class YieldSupplyActiveModel @Inject constructor(
|
|||
private val appRouter: AppRouter,
|
||||
private val yieldSupplyGetDustMinAmountUseCase: YieldSupplyGetDustMinAmountUseCase,
|
||||
private val getYieldBoostStatusUseCase: GetYieldBoostStatusUseCase,
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles,
|
||||
private val boostStoryPreloader: YieldBoostStoryPreloader,
|
||||
) : Model(), YieldSupplyStopEarningComponent.ModelCallback,
|
||||
YieldSupplyApproveComponent.ModelCallback {
|
||||
|
|
@ -236,7 +234,6 @@ internal class YieldSupplyActiveModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun loadBoostBlock() {
|
||||
if (!yieldSupplyFeatureToggles.isYieldPromoEnabled) return
|
||||
modelScope.launch(dispatchers.io) {
|
||||
val token = cryptoCurrency as? CryptoCurrency.Token ?: return@launch
|
||||
val cached = getYieldBoostStatusUseCase(userWalletId).getOrNull()
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.tangem.features.yield.supply.impl.di
|
||||
|
||||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.impl.DefaultYieldSupplyFeatureToggles
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
internal object YieldSupplyFeatureModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideYieldSupplyFeatureToggles(featureTogglesManager: FeatureTogglesManager): YieldSupplyFeatureToggles {
|
||||
return DefaultYieldSupplyFeatureToggles(featureTogglesManager)
|
||||
}
|
||||
}
|
||||
|
|
@ -14,7 +14,6 @@ import com.tangem.domain.tokens.model.details.NavigationAction
|
|||
import com.tangem.domain.yield.supply.promo.usecase.IsYieldBoostPromoEnabledForTokenUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.YieldSupplyEnterStatusUseCase
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyEntryComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.entry.YieldSupplyEntryRoute
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import kotlinx.coroutines.launch
|
||||
|
|
@ -31,7 +30,6 @@ internal class YieldSupplyEntryModel @Inject constructor(
|
|||
private val yieldSupplyEnterStatusUseCase: YieldSupplyEnterStatusUseCase,
|
||||
private val singleAccountStatusListSupplier: SingleAccountStatusListSupplier,
|
||||
private val isYieldBoostPromoEnabledForTokenUseCase: IsYieldBoostPromoEnabledForTokenUseCase,
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles,
|
||||
) : Model() {
|
||||
|
||||
private val params = paramsContainer.require<YieldSupplyEntryComponent.Params>()
|
||||
|
|
@ -96,8 +94,7 @@ internal class YieldSupplyEntryModel @Inject constructor(
|
|||
return if (isActiveYield) {
|
||||
YieldSupplyEntryRoute.Active(cryptoCurrency = token)
|
||||
} else {
|
||||
val isPromoEnabled = yieldSupplyFeatureToggles.isYieldPromoEnabled &&
|
||||
isYieldBoostPromoEnabledForTokenUseCase(userWalletId, token).getOrElse { false }
|
||||
val isPromoEnabled = isYieldBoostPromoEnabledForTokenUseCase(userWalletId, token).getOrElse { false }
|
||||
YieldSupplyEntryRoute.Promo(
|
||||
cryptoCurrency = token,
|
||||
apy = params.apy,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import com.tangem.domain.yield.supply.promo.usecase.GetBoostedApyUseCase
|
|||
import com.tangem.domain.yield.supply.promo.usecase.IsYieldBoostPromoEnabledForTokenUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.*
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics
|
||||
import com.tangem.features.yield.supply.impl.R
|
||||
import com.tangem.features.yield.supply.impl.YieldBoostStoryPreloader
|
||||
|
|
@ -68,7 +67,6 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
private val yieldSupplyGetDustMinAmountUseCase: YieldSupplyGetDustMinAmountUseCase,
|
||||
private val isYieldBoostPromoEnabledForTokenUseCase: IsYieldBoostPromoEnabledForTokenUseCase,
|
||||
private val getBoostedApyUseCase: GetBoostedApyUseCase,
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles,
|
||||
private val boostStoryPreloader: YieldBoostStoryPreloader,
|
||||
) : Model(), YieldSupplyClickIntents {
|
||||
|
||||
|
|
@ -160,9 +158,8 @@ internal class YieldSupplyModel @Inject constructor(
|
|||
val cryptoCurrencyToken = cryptoCurrency as? CryptoCurrency.Token ?: return
|
||||
yieldSupplyGetTokenStatusUseCase(cryptoCurrencyToken)
|
||||
.onRight { tokenStatus ->
|
||||
val isPromoEnabled = yieldSupplyFeatureToggles.isYieldPromoEnabled &&
|
||||
isYieldBoostPromoEnabledForTokenUseCase(params.userWalletId, cryptoCurrencyToken)
|
||||
.getOrElse { false }
|
||||
val isPromoEnabled = isYieldBoostPromoEnabledForTokenUseCase(params.userWalletId, cryptoCurrencyToken)
|
||||
.getOrElse { false }
|
||||
val boostedApy = if (isPromoEnabled) getBoostedApyUseCase(tokenStatus.apy) else null
|
||||
uiStateLegacy.update(
|
||||
YieldSupplyTokenStatusSuccessTransformer(
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.tangem.domain.yield.supply.usecase.YieldSupplyGetProtocolBalanceUseCa
|
|||
import com.tangem.domain.yield.supply.usecase.YieldSupplyGetTokenStatusUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.YieldSupplyMinAmountUseCase
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyActiveComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.impl.YieldBoostStoryPreloader
|
||||
import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider
|
||||
import io.mockk.coEvery
|
||||
|
|
@ -54,7 +53,6 @@ class YieldSupplyActiveModelBoostBlockTest {
|
|||
private val appRouter: AppRouter = mockk(relaxed = true)
|
||||
private val yieldSupplyGetDustMinAmountUseCase: YieldSupplyGetDustMinAmountUseCase = mockk(relaxed = true)
|
||||
private val getYieldBoostStatusUseCase: GetYieldBoostStatusUseCase = mockk(relaxed = true)
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles = mockk(relaxed = true)
|
||||
private val boostStoryPreloader: YieldBoostStoryPreloader = mockk(relaxed = true)
|
||||
private val analyticsHandler: AnalyticsEventHandler = mockk(relaxed = true)
|
||||
|
||||
|
|
@ -83,7 +81,6 @@ class YieldSupplyActiveModelBoostBlockTest {
|
|||
|
||||
@BeforeEach
|
||||
fun setUp() {
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns true
|
||||
every { getUserWalletUseCase.invoke(userWalletId) } returns userWallet.right()
|
||||
every { singleAccountStatusListSupplier.invoke(userWalletId) } returns emptyFlow()
|
||||
coEvery { getSelectedAppCurrencyUseCase.invokeSync() } returns AppCurrency.Default.right()
|
||||
|
|
@ -108,7 +105,6 @@ class YieldSupplyActiveModelBoostBlockTest {
|
|||
appRouter = appRouter,
|
||||
yieldSupplyGetDustMinAmountUseCase = yieldSupplyGetDustMinAmountUseCase,
|
||||
getYieldBoostStatusUseCase = getYieldBoostStatusUseCase,
|
||||
yieldSupplyFeatureToggles = yieldSupplyFeatureToggles,
|
||||
boostStoryPreloader = boostStoryPreloader,
|
||||
)
|
||||
|
||||
|
|
@ -147,16 +143,6 @@ class YieldSupplyActiveModelBoostBlockTest {
|
|||
coVerify(exactly = 1) { getYieldBoostStatusUseCase(userWalletId, true) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `GIVEN promo toggle disabled WHEN model created THEN does not query boost status`() = runTest {
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns false
|
||||
|
||||
val model = createModel()
|
||||
|
||||
assertThat(model.uiState.value.boostText).isNull()
|
||||
coVerify(exactly = 0) { getYieldBoostStatusUseCase(any(), any()) }
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val CONTRACT_ADDRESS = "0xCONTRACT"
|
||||
const val NETWORK_ID = "ethereum"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.tangem.domain.yield.supply.models.YieldSupplyPendingStatus
|
|||
import com.tangem.domain.yield.supply.promo.usecase.IsYieldBoostPromoEnabledForTokenUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.YieldSupplyEnterStatusUseCase
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyEntryComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.entry.YieldSupplyEntryRoute
|
||||
import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider
|
||||
import io.mockk.clearMocks
|
||||
|
|
@ -48,7 +47,6 @@ internal class YieldSupplyEntryModelTest {
|
|||
private val enterStatusUseCase: YieldSupplyEnterStatusUseCase = mockk()
|
||||
private val accountStatusListSupplier: SingleAccountStatusListSupplier = mockk()
|
||||
private val isPromoEnabledUseCase: IsYieldBoostPromoEnabledForTokenUseCase = mockk()
|
||||
private val yieldSupplyFeatureToggles: YieldSupplyFeatureToggles = mockk()
|
||||
|
||||
private val accountStatusList: AccountStatusList = mockk()
|
||||
|
||||
|
|
@ -56,11 +54,10 @@ internal class YieldSupplyEntryModelTest {
|
|||
fun setUp() {
|
||||
clearMocks(
|
||||
router, enterStatusUseCase, accountStatusListSupplier,
|
||||
isPromoEnabledUseCase, yieldSupplyFeatureToggles,
|
||||
isPromoEnabledUseCase,
|
||||
)
|
||||
mockkObject(CryptoCurrencyStatusOperations)
|
||||
coEvery { accountStatusListSupplier.getSyncOrNull(USER_WALLET_ID) } returns accountStatusList
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns true
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
|
@ -176,21 +173,6 @@ internal class YieldSupplyEntryModelTest {
|
|||
assertThat(route.cryptoCurrency).isEqualTo(token())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `GIVEN promo toggle disabled WHEN created THEN Promo route with promo disabled`() = runTest {
|
||||
// Arrange
|
||||
every { yieldSupplyFeatureToggles.isYieldPromoEnabled } returns false
|
||||
stubStatusLookup(status(isActive = false).some())
|
||||
coEvery { enterStatusUseCase(USER_WALLET_ID, any()) } returns null.right()
|
||||
|
||||
// Act
|
||||
createModel(currency = token())
|
||||
|
||||
// Assert
|
||||
val route = captureReplacedRoute()
|
||||
assertThat((route as YieldSupplyEntryRoute.Promo).isPromoEnabled).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `GIVEN promo use case returns false WHEN created THEN Promo route with promo disabled`() = runTest {
|
||||
// Arrange
|
||||
|
|
@ -228,7 +210,6 @@ internal class YieldSupplyEntryModelTest {
|
|||
yieldSupplyEnterStatusUseCase = enterStatusUseCase,
|
||||
singleAccountStatusListSupplier = accountStatusListSupplier,
|
||||
isYieldBoostPromoEnabledForTokenUseCase = isPromoEnabledUseCase,
|
||||
yieldSupplyFeatureToggles = yieldSupplyFeatureToggles,
|
||||
)
|
||||
|
||||
private fun pendingEnter(): YieldSupplyPendingStatus = YieldSupplyPendingStatus.Enter(txIds = listOf("0xTx"))
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import com.tangem.domain.yield.supply.usecase.YieldSupplyGetTokenStatusUseCase
|
|||
import com.tangem.domain.yield.supply.usecase.YieldSupplyIsAvailableUseCase
|
||||
import com.tangem.domain.yield.supply.usecase.YieldSupplyMinAmountUseCase
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyComponent
|
||||
import com.tangem.features.yield.supply.api.YieldSupplyFeatureToggles
|
||||
import com.tangem.features.yield.supply.api.analytics.YieldSupplyAnalytics
|
||||
import com.tangem.features.yield.supply.impl.YieldBoostStoryPreloader
|
||||
import com.tangem.features.yield.supply.impl.main.entity.YieldSupplyUM
|
||||
|
|
@ -87,7 +86,6 @@ internal class YieldSupplyModelTest {
|
|||
private val getDustMinAmountUseCase: YieldSupplyGetDustMinAmountUseCase = mockk()
|
||||
private val isBoostPromoEnabledUseCase: IsYieldBoostPromoEnabledForTokenUseCase = mockk()
|
||||
private val getBoostedApyUseCase = GetBoostedApyUseCase()
|
||||
private val featureToggles: YieldSupplyFeatureToggles = mockk()
|
||||
private val boostStoryPreloader: YieldBoostStoryPreloader = mockk(relaxed = true)
|
||||
|
||||
private val userWalletId = UserWalletId("abcdef012345")
|
||||
|
|
@ -108,7 +106,6 @@ internal class YieldSupplyModelTest {
|
|||
coEvery { singleNetworkStatusFetcher(any()) } returns Unit.right()
|
||||
coEvery { getTokenStatusUseCase(any()) } returns marketToken(isActive = true).right()
|
||||
coEvery { isBoostPromoEnabledUseCase(any(), any()) } returns false.right()
|
||||
every { featureToggles.isYieldPromoEnabled } returns false
|
||||
coEvery { activateUseCase(any(), any(), any()) } returns true.right()
|
||||
coEvery { deactivateUseCase(any(), any()) } returns true.right()
|
||||
coEvery { minAmountUseCase(any(), any()) } returns BigDecimal("5").right()
|
||||
|
|
@ -172,7 +169,6 @@ internal class YieldSupplyModelTest {
|
|||
@Test
|
||||
fun `GIVEN promo enabled for token WHEN status emitted THEN boosted available promo`() = runTest {
|
||||
// Arrange
|
||||
every { featureToggles.isYieldPromoEnabled } returns true
|
||||
coEvery { isBoostPromoEnabledUseCase(any(), any()) } returns true.right()
|
||||
|
||||
// Act
|
||||
|
|
@ -583,7 +579,6 @@ internal class YieldSupplyModelTest {
|
|||
yieldSupplyGetDustMinAmountUseCase = getDustMinAmountUseCase,
|
||||
isYieldBoostPromoEnabledForTokenUseCase = isBoostPromoEnabledUseCase,
|
||||
getBoostedApyUseCase = getBoostedApyUseCase,
|
||||
yieldSupplyFeatureToggles = featureToggles,
|
||||
boostStoryPreloader = boostStoryPreloader,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue