Skip to content

Commit

Permalink
test: increase timeout durations
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed Jul 3, 2024
1 parent afe2a9b commit 5bdbe0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Tests/CoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ class CoreTests: XCTestCase {
return floor(fpc.backdropView.alpha * 1e+06) / 1e+06
}

let timeout = 3.0

let delegate = TestDelegate()
let fpc = FloatingPanelController(delegate: delegate)
fpc.layout = BackdropTestLayout()
Expand All @@ -228,14 +230,14 @@ class CoreTests: XCTestCase {
fpc.move(to: .full, animated: true) {
exp1.fulfill()
}
wait(for: [exp1], timeout: 1.0)
wait(for: [exp1], timeout: timeout)
XCTAssertEqual(_floor(fpc.backdropView.alpha), 0.3)

let exp2 = expectation(description: "move to half with animation")
fpc.move(to: .half, animated: true) {
exp2.fulfill()
}
wait(for: [exp2], timeout: 1.0)
wait(for: [exp2], timeout: timeout)
XCTAssertEqual(fpc.backdropView.alpha, 0.0)

// Test a content mode change of FloatingPanelController
Expand All @@ -246,7 +248,7 @@ class CoreTests: XCTestCase {
}
fpc.contentMode = .fitToBounds
XCTAssertEqual(fpc.backdropView.alpha, 0.0) // Must not affect the backdrop alpha by changing the content mode
wait(for: [exp3], timeout: 1.0)
wait(for: [exp3], timeout: timeout)
XCTAssertEqual(_floor(fpc.backdropView.alpha), 0.3)

// Test a size class change of FloatingPanelController.view
Expand Down

0 comments on commit 5bdbe0f

Please sign in to comment.