From d339c2873334b0eda0468b956adfb0946d9804b8 Mon Sep 17 00:00:00 2001 From: Naufal Aros Date: Mon, 28 Oct 2024 14:09:27 +0100 Subject: [PATCH] Update unit tests --- .../Redirect/RedirectComponentTests.swift | 24 +++++++++++++++---- .../ThreeDS2FingerprintSubmitterTests.swift | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Tests/IntegrationTests/Actions Tests/Redirect/RedirectComponentTests.swift b/Tests/IntegrationTests/Actions Tests/Redirect/RedirectComponentTests.swift index d4a4f09fe7..b6d7efd516 100644 --- a/Tests/IntegrationTests/Actions Tests/Redirect/RedirectComponentTests.swift +++ b/Tests/IntegrationTests/Actions Tests/Redirect/RedirectComponentTests.swift @@ -283,7 +283,11 @@ class RedirectComponentTests: XCTestCase { } delegate.onDidFail = { _, _ in XCTFail("Should not call onDidFail") } - let action = NativeRedirectAction(url: URL(string: "https://google.com")!, paymentData: nil, nativeRedirectData: "test_nativeRedirectData") + let action = RedirectAction( + url: URL(string: "https://google.com")!, + paymentData: nil, + nativeRedirectData: "test_nativeRedirectData" + ) sut.handle(action) XCTAssertTrue(RedirectComponent.applicationDidOpen(from: URL(string: "url://?queryParam=value")!)) @@ -311,7 +315,11 @@ class RedirectComponentTests: XCTestCase { XCTFail("Should not call onDidProvide") } - let action = NativeRedirectAction(url: URL(string: "https://google.com")!, paymentData: nil, nativeRedirectData: "test_nativeRedirectData") + let action = RedirectAction( + url: URL(string: "https://google.com")!, + paymentData: nil, + nativeRedirectData: "test_nativeRedirectData" + ) sut.handle(action) XCTAssertFalse(RedirectComponent.applicationDidOpen(from: URL(string: "url://")!)) @@ -343,7 +351,11 @@ class RedirectComponentTests: XCTestCase { redirectExpectation.fulfill() } - let action = NativeRedirectAction(url: URL(string: "https://google.com")!, paymentData: nil, nativeRedirectData: "test_nativeRedirectData") + let action = RedirectAction( + url: URL(string: "https://google.com")!, + paymentData: nil, + nativeRedirectData: "test_nativeRedirectData" + ) sut.handle(action) XCTAssertTrue(RedirectComponent.applicationDidOpen(from: URL(string: "url://?queryParam=value")!)) @@ -376,7 +388,11 @@ class RedirectComponentTests: XCTestCase { delegate.onDidFail = { _, _ in XCTFail("Should not call onDidFail") } // When - let action = NativeRedirectAction(url: URL(string: "https://google.com")!, paymentData: nil, nativeRedirectData: nil) + let action = RedirectAction( + url: URL(string: "https://google.com")!, + paymentData: nil, + nativeRedirectData: nil + ) sut.handle(action) // Then diff --git a/Tests/IntegrationTests/Card Tests/3DS2 Component/3DS2 Fingerprint Submitter/ThreeDS2FingerprintSubmitterTests.swift b/Tests/IntegrationTests/Card Tests/3DS2 Component/3DS2 Fingerprint Submitter/ThreeDS2FingerprintSubmitterTests.swift index 231040aab5..f0acc3959c 100644 --- a/Tests/IntegrationTests/Card Tests/3DS2 Component/3DS2 Fingerprint Submitter/ThreeDS2FingerprintSubmitterTests.swift +++ b/Tests/IntegrationTests/Card Tests/3DS2 Component/3DS2 Fingerprint Submitter/ThreeDS2FingerprintSubmitterTests.swift @@ -26,7 +26,7 @@ class ThreeDS2FingerprintSubmitterTests: XCTestCase { let apiClient = APIClientMock() let sut = ThreeDS2FingerprintSubmitter(apiContext: Dummy.apiContext, apiClient: apiClient) - let mockedRedirectAction = RedirectAction(url: URL(string: "https://www.adyen.com")!, paymentData: "data", nativeRedirectData: <#String?#>) + let mockedRedirectAction = RedirectAction(url: URL(string: "https://www.adyen.com")!, paymentData: "data") let mockedAction = Action.redirect(mockedRedirectAction) let mockedResponse = Submit3DS2FingerprintResponse(result: .action(mockedAction)) apiClient.mockedResults = [.success(mockedResponse)]