From bd94d13095fe9f99ac50c52261403813d13c6eca Mon Sep 17 00:00:00 2001 From: Lukas Korba Date: Tue, 14 Jun 2022 11:58:21 +0200 Subject: [PATCH] [341] Take Phrase Display Snapshots (#354) - phrase display with mocked data, .demo environment --- secant.xcodeproj/project.pbxproj | 10 +++++++++ .../RecoveryPhraseDisplaySnapshotTests.swift | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 secantTests/SnapshotTests/RecoveryPhraseDisplaySnapshotTests/RecoveryPhraseDisplaySnapshotTests.swift diff --git a/secant.xcodeproj/project.pbxproj b/secant.xcodeproj/project.pbxproj index a236634..c4f14bf 100644 --- a/secant.xcodeproj/project.pbxproj +++ b/secant.xcodeproj/project.pbxproj @@ -139,6 +139,7 @@ 9E92AF0828530EBF007367AD /* View+UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E92AF0728530EBF007367AD /* View+UIImage.swift */; }; 9E9ECC6C2857350F0099D5A2 /* OnboardingSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ECC6B2857350F0099D5A2 /* OnboardingSnapshotTests.swift */; }; 9E9ECC6F285741980099D5A2 /* ImportWalletSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ECC6E285741980099D5A2 /* ImportWalletSnapshotTests.swift */; }; + 9E9ECC72285749750099D5A2 /* RecoveryPhraseDisplaySnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E9ECC71285749750099D5A2 /* RecoveryPhraseDisplaySnapshotTests.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 */; }; @@ -338,6 +339,7 @@ 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 = ""; }; 9E9ECC6E285741980099D5A2 /* ImportWalletSnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImportWalletSnapshotTests.swift; sourceTree = ""; }; + 9E9ECC71285749750099D5A2 /* RecoveryPhraseDisplaySnapshotTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecoveryPhraseDisplaySnapshotTests.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 = ""; }; @@ -792,6 +794,7 @@ children = ( 9E9ECC6A285734F20099D5A2 /* OnboardingSnapshotTests */, 9E9ECC6D2857417F0099D5A2 /* ImportWalletSnapshotTests */, + 9E9ECC702857495B0099D5A2 /* RecoveryPhraseDisplaySnapshotTests */, 9E391163284E3EDE0073DD9A /* WelcomeSnapshotTests */, 9E92AF0728530EBF007367AD /* View+UIImage.swift */, ); @@ -993,6 +996,12 @@ 9E9ECC6E285741980099D5A2 /* ImportWalletSnapshotTests.swift */, ); path = ImportWalletSnapshotTests; + 9E9ECC702857495B0099D5A2 /* RecoveryPhraseDisplaySnapshotTests */ = { + isa = PBXGroup; + children = ( + 9E9ECC71285749750099D5A2 /* RecoveryPhraseDisplaySnapshotTests.swift */, + ); + path = RecoveryPhraseDisplaySnapshotTests; sourceTree = ""; }; 9EAFEB802805791400199FC9 /* AppTests */ = { @@ -1486,6 +1495,7 @@ 9E391165284E3EEA0073DD9A /* WelcomeSnapshotTests.swift in Sources */, 0D4E7A1B26B364180058B01E /* secantTests.swift in Sources */, 0DFE93E6272CB6F7000FCCA5 /* RecoveryPhraseValidationTests.swift in Sources */, + 9E9ECC72285749750099D5A2 /* RecoveryPhraseDisplaySnapshotTests.swift in Sources */, 9E3911392848AD500073DD9A /* HomeTests.swift in Sources */, 9EF8135C27ECC25E0075AF48 /* WalletStorageTests.swift in Sources */, 9E02B56C27FED475005B809B /* DatabaseFilesTests.swift in Sources */, diff --git a/secantTests/SnapshotTests/RecoveryPhraseDisplaySnapshotTests/RecoveryPhraseDisplaySnapshotTests.swift b/secantTests/SnapshotTests/RecoveryPhraseDisplaySnapshotTests/RecoveryPhraseDisplaySnapshotTests.swift new file mode 100644 index 0000000..191b25d --- /dev/null +++ b/secantTests/SnapshotTests/RecoveryPhraseDisplaySnapshotTests/RecoveryPhraseDisplaySnapshotTests.swift @@ -0,0 +1,22 @@ +// +// RecoveryPhraseDisplaySnapshotTests.swift +// secantTests +// +// Created by Lukáš Korba on 13.06.2022. +// + +import XCTest +@testable import secant_testnet +import ComposableArchitecture + +class RecoveryPhraseDisplaySnapshotTests: XCTestCase { + func testRecoveryPhraseDisplaySnapshot() throws { + let store = RecoveryPhraseDisplayStore( + initialState: .init(phrase: .placeholder), + reducer: .default, + environment: .demo + ) + + addAttachments(RecoveryPhraseDisplayView(store: store)) + } +}