From 66fc4148db59cd4bca99629985186e3115fc6d58 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 25 Jul 2022 10:11:49 +0300 Subject: [PATCH] More tests --- .../Sources/UserIndicators/UserIndicatorTests.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/UnitTests/Sources/UserIndicators/UserIndicatorTests.swift b/UnitTests/Sources/UserIndicators/UserIndicatorTests.swift index 948e70461..1717b65dd 100644 --- a/UnitTests/Sources/UserIndicators/UserIndicatorTests.swift +++ b/UnitTests/Sources/UserIndicators/UserIndicatorTests.swift @@ -98,16 +98,16 @@ class UserIndicatorTests: XCTestCase { // MARK: - Dismissal func testDismissAfterTimeout() { - let indicator = makeIndicator(dismissal: .timeout(1.0)) + let interval: TimeInterval = 0.01 + let indicator = makeIndicator(dismissal: .timeout(interval)) indicator.start() - let expectation = expectation(description: "Wait for the indicator to dismiss") - DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { - expectation.fulfill() + let exp = expectation(description: "") + DispatchQueue.main.asyncAfter(deadline: .now() + interval) { + exp.fulfill() } - - wait(for: [expectation], timeout: 5.0) + waitForExpectations(timeout: 1) XCTAssertEqual(indicator.state, .completed) }