Updated on 2026-08-14
This commit is contained in:
parent
09c52231e2
commit
3cc0a643e9
40 changed files with 77 additions and 71 deletions
|
|
@ -335,7 +335,10 @@ class DefaultWalletAccountsFetcherTest {
|
|||
body = SaveWalletAccountsResponse(savedAccountsResponse.accounts),
|
||||
)
|
||||
eTagsStore.clear(userWalletId, ETagsStore.Key.WalletAccounts)
|
||||
userTokensSaver.push(userWalletId = userWalletId, response = savedAccountsResponse.toUserTokensResponse())
|
||||
userTokensSaver.push(
|
||||
userWalletId = userWalletId,
|
||||
response = savedAccountsResponse.toUserTokensResponse(),
|
||||
)
|
||||
tokensMigration.migrate(userWalletId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.tangem.datasource.api.tangemTech.models.account.WalletAccountDTO
|
|||
import com.tangem.datasource.local.datastore.RuntimeStateStore
|
||||
import com.tangem.domain.account.models.AccountList
|
||||
import com.tangem.domain.account.models.ArchivedAccount
|
||||
import com.tangem.domain.models.account.Account
|
||||
import com.tangem.domain.models.account.Account.CryptoPortfolio
|
||||
import com.tangem.domain.models.account.AccountId
|
||||
import com.tangem.domain.models.account.AccountName
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.tangem.data.account.repository
|
|||
|
||||
import app.cash.turbine.test
|
||||
import com.google.common.truth.Truth
|
||||
import com.tangem.common.test.datastore.MockStateDataStore
|
||||
import com.tangem.test.core.datastore.MockStateDataStore
|
||||
import com.tangem.domain.account.models.AccountExpandedState
|
||||
import com.tangem.domain.models.account.AccountId
|
||||
import com.tangem.domain.models.account.DerivationIndex
|
||||
|
|
@ -21,7 +21,7 @@ class DefaultAccountsExpandedRepositoryTest {
|
|||
@Test
|
||||
fun `expandedAccounts emits updated state when store changes`() = runTest {
|
||||
val dataStore = MockStateDataStore<Map<String, Set<AccountsExpandedDTO>>>(
|
||||
default = emptyMap()
|
||||
default = emptyMap(),
|
||||
)
|
||||
|
||||
val repository = DefaultAccountsExpandedRepository(dataStore)
|
||||
|
|
@ -37,9 +37,9 @@ class DefaultAccountsExpandedRepositoryTest {
|
|||
walletId.stringValue to setOf(
|
||||
AccountsExpandedDTO(
|
||||
accountId = mainAccountId.value,
|
||||
isExpanded = true
|
||||
)
|
||||
)
|
||||
isExpanded = true,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -60,14 +60,14 @@ class DefaultAccountsExpandedRepositoryTest {
|
|||
@Test
|
||||
fun `expandedAccounts emits when update is called`() = runTest {
|
||||
val dataStore = MockStateDataStore<Map<String, Set<AccountsExpandedDTO>>>(
|
||||
default = emptyMap()
|
||||
default = emptyMap(),
|
||||
)
|
||||
|
||||
val repository = DefaultAccountsExpandedRepository(dataStore)
|
||||
|
||||
val state = AccountExpandedState(
|
||||
accountId = mainAccountId,
|
||||
isExpanded = true
|
||||
isExpanded = true,
|
||||
)
|
||||
|
||||
repository.expandedAccounts.test {
|
||||
|
|
@ -94,9 +94,9 @@ class DefaultAccountsExpandedRepositoryTest {
|
|||
mapOf(
|
||||
walletId.stringValue to setOf(
|
||||
AccountsExpandedDTO(mainAccountId.value, true),
|
||||
AccountsExpandedDTO(secondAccountId.value, false)
|
||||
)
|
||||
)
|
||||
AccountsExpandedDTO(secondAccountId.value, false),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
val repository = DefaultAccountsExpandedRepository(dataStore)
|
||||
|
|
@ -109,7 +109,7 @@ class DefaultAccountsExpandedRepositoryTest {
|
|||
// when
|
||||
repository.syncStore(
|
||||
walletId = walletId,
|
||||
existAccounts = setOf(mainAccountId) // without secondAccountId
|
||||
existAccounts = setOf(mainAccountId), // without secondAccountId
|
||||
)
|
||||
|
||||
// then
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.tangem.data.account.store
|
|||
import android.content.Context
|
||||
import com.google.common.truth.Truth
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.tangem.common.test.TestAppCoroutineScope
|
||||
import com.tangem.test.core.TestAppCoroutineScope
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import io.mockk.clearMocks
|
||||
import io.mockk.mockk
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.tangem.data.account.token
|
||||
|
||||
import arrow.core.right
|
||||
import com.tangem.common.test.TestAppCoroutineScope
|
||||
import com.tangem.test.core.TestAppCoroutineScope
|
||||
import com.tangem.data.account.converter.createGetWalletAccountsResponse
|
||||
import com.tangem.data.account.converter.createWalletAccountDTO
|
||||
import com.tangem.data.account.store.AccountsResponseStore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue