Skip to content

Commit

Permalink
ApplicationState troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
goergisn committed Oct 9, 2023
1 parent d4f00b4 commit 1805bfe
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Tests/DropIn Tests/DropInTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ class DropInTests: XCTestCase {
wait(for: .seconds(2))
let newtopVC = self.sut.viewController.findChild(of: ADYViewController.self)
XCTAssertEqual(newtopVC?.title, "Apple Pay")

XCTFail("\(UIApplication.shared.applicationState.name)")
}

func testGiftCard() {
Expand Down Expand Up @@ -239,8 +237,6 @@ class DropInTests: XCTestCase {
XCTAssertEqual(topVC!.sections.count, 2)
XCTAssertEqual(topVC!.sections[0].items.count, 2)
XCTAssertTrue(topVC!.sections[0].footer!.title.contains("Select payment method for the remaining"))

XCTFail("\(UIApplication.shared.applicationState.name)")
}

func testSinglePaymentMethodSkippingPaymentList() {
Expand All @@ -261,8 +257,6 @@ class DropInTests: XCTestCase {
let topVC = sut.viewController.findChild(of: SecuredViewController<FormViewController>.self)
XCTAssertNotNil(topVC)
XCTAssertEqual(topVC?.title, "SEPA Direct Debit")

XCTFail("\(UIApplication.shared.applicationState.name)")
}

func testSinglePaymentMethodNotSkippingPaymentList() {
Expand All @@ -284,8 +278,6 @@ class DropInTests: XCTestCase {
XCTAssertNotNil(topVC)
XCTAssertEqual(topVC!.sections.count, 1)
XCTAssertEqual(topVC!.sections[0].items.count, 1)

XCTFail("\(UIApplication.shared.applicationState.name)")
}

func testFinaliseIfNeededEmptyList() {
Expand All @@ -306,13 +298,15 @@ class DropInTests: XCTestCase {
}

waitForExpectations(timeout: 5, handler: nil)

XCTFail("\(UIApplication.shared.applicationState.name)")
}

func testXDidCancelOnRedirect() throws {
func testDidCancelOnRedirect() throws {
let config = DropInComponent.Configuration()


XCTAssertEqual("\(UIApplication.shared.applicationState.name)", "")
UIApplication.shared.open(.init(string: "random-app://")!) { _ in }
XCTAssertEqual("\(UIApplication.shared.applicationState.name)", "")

let paymentMethodsData = try XCTUnwrap(DropInTests.paymentMethodsWithSingleInstant.data(using: .utf8))
let paymentMethods = try JSONDecoder().decode(PaymentMethods.self, from: paymentMethodsData)

Expand Down

0 comments on commit 1805bfe

Please sign in to comment.