-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding snapshot tests for SecuredViewController
- Loading branch information
Showing
11 changed files
with
74 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+7.6 KB
(100%)
...ivenDeliveryAddressIsNotSet-iPhone12.shopper-info-prefilled-address-not-set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.1 KB
(110%)
...lling_givenDeliveryAddressIsSet-iPhone12.shopper-info-prefilled-address-set.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.45 KB
(100%)
...givenNoShopperInformation_shouldNotPrefill-iPhone12.shopper-info-not-filled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11.9 KB
(110%)
...Form_shouldCallDelegateWithProperParameters-iPhone12.shopper-info-prefilled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.07 KB
(100%)
..._/BoletoComponentUITests/testPaymentDataNoName-iPhone12.boleto_flow_no_name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.5 KB
(110%)
...hots__/BoletoComponentUITests/testUIConfiguration-iPhone12.UI_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
|
||
import XCTest | ||
@_spi(AdyenInternal) @testable import Adyen | ||
@testable import AdyenComponents | ||
@testable import AdyenCard | ||
|
||
class SecuredViewControllerUITests: XCTestCase { | ||
|
||
func testBlur() throws { | ||
struct DummyStyle: ViewStyle { | ||
var backgroundColor: UIColor | ||
} | ||
|
||
let cardComponent = CardComponent( | ||
paymentMethod: CardPaymentMethod( | ||
type: .scheme, | ||
name: "scheme", | ||
fundingSource: .credit, | ||
brands: [.bcmc] | ||
), | ||
context: Dummy.context | ||
) | ||
|
||
let sut = try XCTUnwrap(cardComponent.viewController as? SecuredViewController<CardViewController>) | ||
setupRootViewController(sut) | ||
|
||
try withoutAnimation { | ||
NotificationCenter.default.post(name: UIApplication.willResignActiveNotification, object: nil) | ||
wait { sut.view.subviews.contains(where: { $0 is UIVisualEffectView }) } | ||
verifyViewControllerImage(matching: sut, named: "secured-view-controller-blurred") | ||
|
||
NotificationCenter.default.post(name: UIApplication.didBecomeActiveNotification, object: nil) | ||
wait { !sut.view.subviews.contains(where: { $0 is UIVisualEffectView }) } | ||
verifyViewControllerImage(matching: sut, named: "secured-view-controller-unblurred") | ||
} | ||
} | ||
} |
Binary file added
BIN
+228 KB
...uredViewControllerUITests/testBlur-iPhone12.secured-view-controller-blurred.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+103 KB
...edViewControllerUITests/testBlur-iPhone12.secured-view-controller-unblurred.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters