From edeb3f7fee29d8edee8f9f14717a21ac5f9e6d08 Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Tue, 14 Jun 2022 11:51:13 +0200 Subject: [PATCH] [340] Take Onboarding Snapshots (#352) - the OnboardingFlow info steps snapshots [340] Take Onboarding Snapshots (352) - cleanup --- secant.xcodeproj/project.pbxproj | 12 +++++ .../OnboardingSnapshotTests.swift | 48 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 secantTests/SnapshotTests/OnboardingSnapshotTests/OnboardingSnapshotTests.swift diff --git a/secant.xcodeproj/project.pbxproj b/secant.xcodeproj/project.pbxproj index a9bf33e..e4d32dc 100644 --- a/secant.xcodeproj/project.pbxproj +++ b/secant.xcodeproj/project.pbxproj @@ -137,6 +137,7 @@ 9E7FE0F92832824C00C374E8 /* QRCodeScanView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E7FE0F82832824C00C374E8 /* QRCodeScanView.swift */; }; 9E87ADF128363DE400122FCC /* WrappedAudioServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E87ADF028363DE400122FCC /* WrappedAudioServices.swift */; }; 9E92AF0828530EBF007367AD /* View+UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E92AF0728530EBF007367AD /* View+UIImage.swift */; }; + 9E9ECC6C2857350F0099D5A2 /* OnboardingSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ECC6B2857350F0099D5A2 /* OnboardingSnapshotTests.swift */; }; 9EAFEB822805793200199FC9 /* AppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EAFEB812805793200199FC9 /* AppTests.swift */; }; 9EAFEB84280597B700199FC9 /* WrappedSecItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EAFEB83280597B700199FC9 /* WrappedSecItem.swift */; }; 9EAFEB862805A23100199FC9 /* WrappedSecItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EAFEB852805A23100199FC9 /* WrappedSecItemTests.swift */; }; @@ -334,6 +335,7 @@ 9E7FE0F82832824C00C374E8 /* QRCodeScanView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeScanView.swift; sourceTree = ""; }; 9E87ADF028363DE400122FCC /* WrappedAudioServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrappedAudioServices.swift; sourceTree = ""; }; 9E92AF0728530EBF007367AD /* View+UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+UIImage.swift"; sourceTree = ""; }; + 9E9ECC6B2857350F0099D5A2 /* OnboardingSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingSnapshotTests.swift; sourceTree = ""; }; 9EAFEB812805793200199FC9 /* AppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTests.swift; sourceTree = ""; }; 9EAFEB83280597B700199FC9 /* WrappedSecItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrappedSecItem.swift; sourceTree = ""; }; 9EAFEB852805A23100199FC9 /* WrappedSecItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrappedSecItemTests.swift; sourceTree = ""; }; @@ -786,6 +788,7 @@ 9E391162284E3ECF0073DD9A /* SnapshotTests */ = { isa = PBXGroup; children = ( + 9E9ECC6A285734F20099D5A2 /* OnboardingSnapshotTests */, 9E391163284E3EDE0073DD9A /* WelcomeSnapshotTests */, 9E92AF0728530EBF007367AD /* View+UIImage.swift */, ); @@ -975,6 +978,14 @@ path = UIKitBridge; sourceTree = ""; }; + 9E9ECC6A285734F20099D5A2 /* OnboardingSnapshotTests */ = { + isa = PBXGroup; + children = ( + 9E9ECC6B2857350F0099D5A2 /* OnboardingSnapshotTests.swift */, + ); + path = OnboardingSnapshotTests; + sourceTree = ""; + }; 9EAFEB802805791400199FC9 /* AppTests */ = { isa = PBXGroup; children = ( @@ -1468,6 +1479,7 @@ 9E3911392848AD500073DD9A /* HomeTests.swift in Sources */, 9EF8135C27ECC25E0075AF48 /* WalletStorageTests.swift in Sources */, 9E02B56C27FED475005B809B /* DatabaseFilesTests.swift in Sources */, + 9E9ECC6C2857350F0099D5A2 /* OnboardingSnapshotTests.swift in Sources */, 9EF8135D27ECC25E0075AF48 /* UserPreferencesStorageTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/secantTests/SnapshotTests/OnboardingSnapshotTests/OnboardingSnapshotTests.swift b/secantTests/SnapshotTests/OnboardingSnapshotTests/OnboardingSnapshotTests.swift new file mode 100644 index 0000000..826a3d0 --- /dev/null +++ b/secantTests/SnapshotTests/OnboardingSnapshotTests/OnboardingSnapshotTests.swift @@ -0,0 +1,48 @@ +// +// OnboardingSnapshotTests.swift +// secantTests +// +// Created by Lukáš Korba on 13.06.2022. +// + +import XCTest +@testable import secant_testnet +import ComposableArchitecture + +class OnboardingSnapshotTests: XCTestCase { + func testOnboardingFlowSnapshot() throws { + let store = OnboardingFlowStore( + initialState: OnboardingFlowState(importWalletState: .placeholder), + reducer: .default, + environment: .demo + ) + let viewStore = ViewStore(store) + + // step 1 + addAttachments( + name: "\(#function)_info1", + OnboardingScreen(store: store) + ) + + // step 2 + viewStore.send(.next) + addAttachments( + name: "\(#function)_info2", + OnboardingScreen(store: store) + ) + + // step 3 + viewStore.send(.next) + addAttachments( + name: "\(#function)_info3", + OnboardingScreen(store: store) + ) + + // step 4 + viewStore.send(.next) + addAttachments( + name: "\(#function)_info4", + OnboardingScreen(store: store) + ) + } +}