Skip to content

Commit

Permalink
UIApplication troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
goergisn committed Oct 9, 2023
1 parent 411678e commit 4ad30bc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Tests/DropIn Tests/DropInTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class DropInTests: XCTestCase {

var sut: DropInComponent!
var context: AdyenContext!

override func setUpWithError() throws {
try super.setUpWithError()
context = Dummy.context
Expand Down Expand Up @@ -158,7 +158,16 @@ class DropInTests: XCTestCase {
}

delegateMock.didOpenExternalApplicationHandler = { component in
XCTFail("Did open external application handler should not be called (\(String(describing: component)))")

let applicationState: String
switch UIApplication.shared.applicationState {
case .active: applicationState = "ACTIVE"
case .background: applicationState = "BACKGROUND"
case .inactive: applicationState = "INACTIVE"
@unknown default: applicationState = "UNKNOWN DEFAULT"
}

XCTFail("Did open external application handler should not be called (\(String(describing: component))) - \(applicationState)")
}

sut.delegate = delegateMock
Expand Down

0 comments on commit 4ad30bc

Please sign in to comment.