From a2211f3ef9ddf000bce6b671eb020532077789ec Mon Sep 17 00:00:00 2001 From: Nikhil Date: Tue, 23 Apr 2024 17:11:52 +0200 Subject: [PATCH] PR comments --- README.md | 9 ++++++++ .../SnapshotTesting+Extensions.swift | 3 --- .../Extensions/UIView+Extensions.swift | 22 +++++++++---------- .../Helpers/MockAccountDetailsUseCase.swift | 2 +- Tests/SnapshotTests/Helpers/Simulator.swift | 3 --- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 852f4ad..1c74fc5 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,12 @@ pod repo-art add backbase-pods-design "https://repo.backbase.com/artifactory/api ## Usage and login The Golden Sample App is configured to use the API Sandbox environment out of the box. To be able to connect to this environment you need a Sandbox API key which can be obtained from the API Sandbox team and needs to be added to config.json. To login to the app the API Sandbox [test accounts](https://backbase.io/developers/documentation/api-sandbox/retail-banking-usa/retail-user-credentials/) can be used. + +## Test plan +- To modify the test plan +```bash +1. Go to the Snapshot scheme +2. Click on the Edit the scheme +3. Click on the respective test plan +4. Modify the details +``` diff --git a/Tests/SnapshotTests/Extensions/SnapshotTesting+Extensions.swift b/Tests/SnapshotTests/Extensions/SnapshotTesting+Extensions.swift index 39ddf69..c0c5caf 100644 --- a/Tests/SnapshotTests/Extensions/SnapshotTesting+Extensions.swift +++ b/Tests/SnapshotTests/Extensions/SnapshotTesting+Extensions.swift @@ -33,8 +33,6 @@ extension UITraitCollection { .init(verticalSizeClass: .regular) ] ) - @unknown default: - fatalError("Fatal: unknown value for orientation") } } } @@ -46,7 +44,6 @@ extension ViewImageConfig.Orientation: CustomStringConvertible { switch self { case .landscape: return "landscape" case .portrait: return "portrait" - @unknown default: return "unknownOrientation" } } } diff --git a/Tests/SnapshotTests/Extensions/UIView+Extensions.swift b/Tests/SnapshotTests/Extensions/UIView+Extensions.swift index 3a546f1..4b2c0fb 100644 --- a/Tests/SnapshotTests/Extensions/UIView+Extensions.swift +++ b/Tests/SnapshotTests/Extensions/UIView+Extensions.swift @@ -8,35 +8,35 @@ import BackbaseDesignSystem extension UIView { func setSizeConstraints(size: CGSize) -> UIView { - self.translatesAutoresizingMaskIntoConstraints = false + translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ - self.widthAnchor.constraint(equalToConstant: size.width), - self.heightAnchor.constraint(equalToConstant: size.height) + widthAnchor.constraint(equalToConstant: size.width), + heightAnchor.constraint(equalToConstant: size.height) ]) return self } func containerCenterAligned(size: CGSize = CGSize(width: 200, height: 100), backgroundColor: UIColor = DesignSystem.shared.colors.surfaceSecondary.default) -> UIView { - self.translatesAutoresizingMaskIntoConstraints = false + translatesAutoresizingMaskIntoConstraints = false let view = containerView(size: size, backgroundColor: backgroundColor) NSLayoutConstraint.activate([ - self.centerXAnchor.constraint(equalTo: view.centerXAnchor), - self.centerYAnchor.constraint(equalTo: view.centerYAnchor) + centerXAnchor.constraint(equalTo: view.centerXAnchor), + centerYAnchor.constraint(equalTo: view.centerYAnchor) ]) return view } func containerCornerAttached(size: CGSize = CGSize(width: 200, height: 100), backgroundColor: UIColor = DesignSystem.shared.colors.surfaceSecondary.default) -> UIView { - self.translatesAutoresizingMaskIntoConstraints = false + translatesAutoresizingMaskIntoConstraints = false let view = containerView(size: size, backgroundColor: backgroundColor) NSLayoutConstraint.activate([ - self.topAnchor.constraint(equalTo: view.topAnchor, constant: 16), - self.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -16), - self.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16), - self.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16) + topAnchor.constraint(equalTo: view.topAnchor, constant: 16), + bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -16), + leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16), + trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16) ]) return view } diff --git a/Tests/SnapshotTests/Helpers/MockAccountDetailsUseCase.swift b/Tests/SnapshotTests/Helpers/MockAccountDetailsUseCase.swift index ba22aad..45c770b 100644 --- a/Tests/SnapshotTests/Helpers/MockAccountDetailsUseCase.swift +++ b/Tests/SnapshotTests/Helpers/MockAccountDetailsUseCase.swift @@ -11,7 +11,7 @@ import ArrangementsClient2Gen2 class MockAccountDetailsUseCase: AccountDetailsUseCase { - private var shouldReturnError = false + private var shouldReturnError: Bool private var fileName: String init(shouldReturnError: Bool = false, fileName: String = "arrangement.json") { diff --git a/Tests/SnapshotTests/Helpers/Simulator.swift b/Tests/SnapshotTests/Helpers/Simulator.swift index 5676fb6..f49d0c0 100644 --- a/Tests/SnapshotTests/Helpers/Simulator.swift +++ b/Tests/SnapshotTests/Helpers/Simulator.swift @@ -9,12 +9,9 @@ import UIKit enum Simulator: CaseIterable { case iPhone8(ViewImageConfig) - case iPhone11(ViewImageConfig) - case iPhone14ProMax(ViewImageConfig) - /// The `ViewImageConfig` associated with the enum case var config: ViewImageConfig { switch self {