Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nauaros committed Oct 28, 2024
1 parent a8f3f1c commit d339c28
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")!))

Expand Down Expand Up @@ -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://")!))

Expand Down Expand Up @@ -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")!))

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit d339c28

Please sign in to comment.