Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

No bug: Wallet unit test fixup #7756

Merged
merged 2 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Tests/BraveWalletTests/AccountActivityStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class AccountActivityStoreTests: XCTestCase {
}

func testUpdateEthereumAccount() {
let firstTransactionDate = Date(timeIntervalSince1970: 1636399671) // Monday, November 8, 2021 7:27:51 PM
let account: BraveWallet.AccountInfo = .mockEthAccount
let formatter = WeiFormatter(decimalFormatStyle: .decimals(precision: 18))
let mockEthDecimalBalance: Double = 0.0896
Expand All @@ -131,7 +132,11 @@ class AccountActivityStoreTests: XCTestCase {
mockEthBalanceWei: mockEthBalanceWei,
mockERC20BalanceWei: mockERC20BalanceWei,
mockERC721BalanceWei: mockERC721BalanceWei,
transactions: [ethSendTxCopy, goerliSwapTxCopy]
transactions: [goerliSwapTxCopy, ethSendTxCopy].enumerated().map { (index, tx) in
// transactions sorted by created time, make sure they are in-order
tx.createdTime = firstTransactionDate.addingTimeInterval(TimeInterval(index * 10))
return tx
}
)

let mockAssetManager = TestableWalletUserAssetManager()
Expand Down Expand Up @@ -232,6 +237,7 @@ class AccountActivityStoreTests: XCTestCase {
}

func testUpdateSolanaAccount() {
let firstTransactionDate = Date(timeIntervalSince1970: 1636399671) // Monday, November 8, 2021 7:27:51 PM
let account: BraveWallet.AccountInfo = .mockSolAccount
let mockLamportBalance: UInt64 = 3876535000 // ~3.8765 SOL
let mockSolDecimalBalance: Double = 3.8765 // rounded
Expand All @@ -253,7 +259,11 @@ class AccountActivityStoreTests: XCTestCase {
let (keyringService, rpcService, walletService, blockchainRegistry, assetRatioService, txService, solTxManagerProxy, ipfsApi) = setupServices(
mockLamportBalance: mockLamportBalance,
mockSplTokenBalances: mockSplTokenBalances,
transactions: [solSendTxCopy, solTestnetSendTxCopy]
transactions: [solTestnetSendTxCopy, solSendTxCopy].enumerated().map { (index, tx) in
// transactions sorted by created time, make sure they are in-order
tx.createdTime = firstTransactionDate.addingTimeInterval(TimeInterval(index * 10))
return tx
}
)

let mockAssetManager = TestableWalletUserAssetManager()
Expand Down
17 changes: 7 additions & 10 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,17 @@ platform :ios do
"ClientTests/UserAgentTests",
"ClientTests/AdBlockEngineManagerTests/testPerformance",
"DataTests",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemoveAllPermissions",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissions",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissionsLastPermission",
"BraveWalletTests/SendTokenStoreTests/testSNSAddressResolution",
"BraveWalletTests/SendTokenStoreTests/testSNSAddressResolutionFailure",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemoveAllPermissions",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissions",
"BraveWalletTests/ManageSiteConnectionsStoreTests/testRemovePermissionsLastPermission",
"BraveWalletTests/SendTokenStoreTests/testResolvedAddressUsedInSolTxIfAvailable",
"BraveWalletTests/SendTokenStoreTests/testENSAddressResolution",
"BraveWalletTests/SendTokenStoreTests/testENSAddressResolutionOffchain",
"BraveWalletTests/SendTokenStoreTests/testENSAddressResolutionFailure",
"BraveWalletTests/SendTokenStoreTests/testResolvedAddressUsedInEthTxIfAvailable",
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionEthNetwork",
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionFailure",
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionSolNetwork",
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionTokenChange"
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionFailure",
"BraveWalletTests/SendTokenStoreTests/testUDAddressResolutionTokenChange",
"BraveWalletTests/TransactionConfirmationStoreTests/testPrepareERC20Approve",
"BraveWalletTests/TransactionConfirmationStoreTests/testPrepareTransactionNotOnSelectedNetwork",
]
)

Expand Down