2022-10-03 06:39:40 -07:00
|
|
|
//
|
|
|
|
// TransactionSendingTests.swift
|
|
|
|
// secantTests
|
|
|
|
//
|
|
|
|
// Created by Michal Fousek on 30.09.2022.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
@testable import secant_testnet
|
|
|
|
import ComposableArchitecture
|
|
|
|
import SwiftUI
|
|
|
|
import ZcashLightClientKit
|
|
|
|
|
|
|
|
class TransactionSendingTests: XCTestCase {
|
|
|
|
func testTransactionSendingSnapshot() throws {
|
|
|
|
let testEnvironment = SendFlowEnvironment(
|
|
|
|
derivationTool: .live(derivationTool: DerivationTool(networkType: .testnet)),
|
|
|
|
mnemonic: .mock,
|
|
|
|
numberFormatter: .live(),
|
|
|
|
SDKSynchronizer: MockWrappedSDKSynchronizer(),
|
|
|
|
scheduler: DispatchQueue.main.eraseToAnyScheduler(),
|
|
|
|
walletStorage: .live(),
|
|
|
|
zcashSDKEnvironment: .testnet
|
|
|
|
)
|
|
|
|
|
|
|
|
var state = SendFlowState.placeholder
|
|
|
|
state.addMemoState = true
|
|
|
|
state.transactionAddressInputState = TransactionAddressTextFieldState(
|
2022-11-05 08:47:11 -07:00
|
|
|
textFieldState: TCATextFieldReducer.State(
|
2022-10-03 06:39:40 -07:00
|
|
|
validationType: nil,
|
|
|
|
text: "ztestmockeddestinationaddress"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
state.transactionAmountInputState = TransactionAmountTextFieldState(
|
|
|
|
currencySelectionState: CurrencySelectionState(),
|
2022-11-05 08:47:11 -07:00
|
|
|
textFieldState: TCATextFieldReducer.State(
|
2022-10-03 06:39:40 -07:00
|
|
|
validationType: nil,
|
|
|
|
text: "2.91"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
let store = Store(
|
|
|
|
initialState: state,
|
|
|
|
reducer: SendFlowReducer.default,
|
|
|
|
environment: testEnvironment
|
|
|
|
)
|
|
|
|
|
|
|
|
ViewStore(store).send(.onAppear)
|
|
|
|
addAttachments(TransactionSendingView(viewStore: ViewStore(store)))
|
|
|
|
}
|
|
|
|
}
|