mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
More tests
This commit is contained in:
parent
cc6d08004a
commit
66fc4148db
@ -98,16 +98,16 @@ class UserIndicatorTests: XCTestCase {
|
|||||||
// MARK: - Dismissal
|
// MARK: - Dismissal
|
||||||
|
|
||||||
func testDismissAfterTimeout() {
|
func testDismissAfterTimeout() {
|
||||||
let indicator = makeIndicator(dismissal: .timeout(1.0))
|
let interval: TimeInterval = 0.01
|
||||||
|
let indicator = makeIndicator(dismissal: .timeout(interval))
|
||||||
|
|
||||||
indicator.start()
|
indicator.start()
|
||||||
|
|
||||||
let expectation = expectation(description: "Wait for the indicator to dismiss")
|
let exp = expectation(description: "")
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + interval) {
|
||||||
expectation.fulfill()
|
exp.fulfill()
|
||||||
}
|
}
|
||||||
|
waitForExpectations(timeout: 1)
|
||||||
wait(for: [expectation], timeout: 5.0)
|
|
||||||
|
|
||||||
XCTAssertEqual(indicator.state, .completed)
|
XCTAssertEqual(indicator.state, .completed)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user