Added TanProcedures, TanMedia, TanChallenge, ImageTanChallenge and FlickerCodeTanChallenge to PreviewData
This commit is contained in:
parent
22c262f4c4
commit
003b4b3b55
|
@ -4,6 +4,17 @@ import BankingUiSwift
|
|||
|
||||
let previewBanks = createPreviewBanks()
|
||||
|
||||
let previewTanProcedures = createPreviewTanProcedures()
|
||||
|
||||
let previewTanMedia = createPreviewTanMedia()
|
||||
|
||||
let previewTanChallenge = TanChallenge(messageToShowToUser: "Hier ist eine Nachricht deiner Bank, die dir die Welt erklaert", tanProcedure: previewTanProcedures[0])
|
||||
|
||||
let previewImageTanChallenge = ImageTanChallenge(image: TanImage(mimeType: "image/png", imageBytes: KotlinByteArray(size: 0), decodingError: nil), messageToShowToUser: "", tanProcedure: previewTanProcedures[1])
|
||||
|
||||
let previewFlickerCodeTanChallenge = FlickerCodeTanChallenge(flickerCode: FlickerCode(challengeHHD_UC: "", parsedDataSet: "", decodingError: nil), messageToShowToUser: "", tanProcedure: previewTanProcedures[0])
|
||||
|
||||
|
||||
func createPreviewBanks() -> [Customer] {
|
||||
let bank1 = Customer(bankCode: "", customerId: "", password: "", finTsServerAddress: "", bankName: "Abzockbank", bic: "", customerName: "Marieke Musterfrau", userId: "", iconUrl: "", accounts: [])
|
||||
|
||||
|
@ -22,3 +33,19 @@ func createPreviewBanks() -> [Customer] {
|
|||
|
||||
return [ bank1, bank2 ]
|
||||
}
|
||||
|
||||
|
||||
func createPreviewTanProcedures() -> [TanProcedure] {
|
||||
return [
|
||||
TanProcedure(displayName: "chipTAN optisch", type: .chiptanflickercode, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .numeric),
|
||||
TanProcedure(displayName: "chipTAN QR", type: .chiptanqrcode, bankInternalProcedureCode: "", maxTanInputLength: 8, allowedTanFormat: .numeric),
|
||||
TanProcedure(displayName: "Secure Super Duper Plus", type: .apptan, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .alphanumeric)
|
||||
]
|
||||
}
|
||||
|
||||
func createPreviewTanMedia() -> [TanMedium] {
|
||||
return [
|
||||
TanMedium(displayName: "EC-Karte mit Nummer 12345678", status: .available),
|
||||
TanMedium(displayName: "Handy mit Nummer 0170 / 12345678", status: .available)
|
||||
]
|
||||
}
|
||||
|
|
|
@ -213,18 +213,11 @@ struct EnterTanDialog: View {
|
|||
struct EnterTanDialog_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let customer = Customer(bankCode: "", customerId: "", password: "", finTsServerAddress: "")
|
||||
customer.supportedTanProcedures = [
|
||||
TanProcedure(displayName: "chipTAN optisch", type: .chiptanflickercode, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .numeric),
|
||||
TanProcedure(displayName: "chipTAN QR", type: .chiptanqrcode, bankInternalProcedureCode: "", maxTanInputLength: 8, allowedTanFormat: .numeric),
|
||||
TanProcedure(displayName: "Secure Super Duper Plus", type: .apptan, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .alphanumeric)
|
||||
]
|
||||
customer.supportedTanProcedures = previewTanProcedures
|
||||
|
||||
customer.tanMedia = [
|
||||
TanMedium(displayName: "EC-Karte mit Nummer 12345678", status: .available),
|
||||
TanMedium(displayName: "Handy mit Nummer 0170 / 12345678", status: .available)
|
||||
]
|
||||
customer.tanMedia = previewTanMedia
|
||||
|
||||
let tanChallenge = TanChallenge(messageToShowToUser: "Hier ist eine Nachricht deiner Bank, die dir die Welt erklaert", tanProcedure: customer.supportedTanProcedures[0])
|
||||
let tanChallenge = previewTanChallenge
|
||||
|
||||
let enterTanState = EnterTanState(customer, tanChallenge, { result in })
|
||||
|
||||
|
|
|
@ -72,9 +72,7 @@ struct ImageTanView: View {
|
|||
struct ImageTanView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
let tanChallenge = ImageTanChallenge(image: TanImage(mimeType: "image/png", imageBytes: KotlinByteArray(size: 0), decodingError: nil), messageToShowToUser: "", tanProcedure: TanProcedure(displayName: "", type: .phototan, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .numeric))
|
||||
|
||||
return ImageTanView(tanChallenge)
|
||||
return ImageTanView(previewImageTanChallenge)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue