2022-10-03 06:39:40 -07:00
|
|
|
//
|
2022-11-17 03:25:55 -08:00
|
|
|
// TransactionSendingSnapshotTests.swift
|
2022-10-03 06:39:40 -07:00
|
|
|
// 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 {
|
2022-11-08 11:02:55 -08:00
|
|
|
var state = SendFlowReducer.State.placeholder
|
2022-10-03 06:39:40 -07:00
|
|
|
state.addMemoState = true
|
2022-11-07 02:53:20 -08:00
|
|
|
state.transactionAddressInputState = TransactionAddressTextFieldReducer.State(
|
2022-11-05 08:47:11 -07:00
|
|
|
textFieldState: TCATextFieldReducer.State(
|
2022-10-03 06:39:40 -07:00
|
|
|
validationType: nil,
|
2023-02-13 11:32:50 -08:00
|
|
|
text: "ztestmockeddestinationaddress".redacted
|
2022-10-03 06:39:40 -07:00
|
|
|
)
|
|
|
|
)
|
2022-11-08 00:36:03 -08:00
|
|
|
state.transactionAmountInputState = TransactionAmountTextFieldReducer.State(
|
2022-11-07 02:53:39 -08:00
|
|
|
currencySelectionState: CurrencySelectionReducer.State(),
|
2022-11-05 08:47:11 -07:00
|
|
|
textFieldState: TCATextFieldReducer.State(
|
2022-10-03 06:39:40 -07:00
|
|
|
validationType: nil,
|
2023-02-13 11:32:50 -08:00
|
|
|
text: "2.91".redacted
|
2022-10-03 06:39:40 -07:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
let store = Store(
|
|
|
|
initialState: state,
|
2022-11-08 11:02:55 -08:00
|
|
|
reducer: SendFlowReducer()
|
2023-02-22 06:06:43 -08:00
|
|
|
.dependency(\.derivationTool, .live())
|
2022-11-08 11:02:55 -08:00
|
|
|
.dependency(\.mainQueue, DispatchQueue.main.eraseToAnyScheduler())
|
|
|
|
.dependency(\.numberFormatter, .live())
|
2022-11-17 03:25:55 -08:00
|
|
|
.dependency(\.walletStorage, .live())
|
2022-10-03 06:39:40 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
ViewStore(store).send(.onAppear)
|
|
|
|
addAttachments(TransactionSendingView(viewStore: ViewStore(store)))
|
|
|
|
}
|
|
|
|
}
|