Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bgoncal committed Nov 28, 2023
1 parent 109addd commit 57470c9
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ final class ThreadCredentialsSharingViewModelTests: XCTestCase {
mockClient = nil
}

func test_retrieveAllCredentials_calls_retrieveAllCredentials() {
// Given
let expectation = XCTestExpectation(description: "retrieveAllCredentials returned")

func test_retrieveAllCredentials_calls_retrieveAllCredentials() async {
// When
Task {
await sut.retrieveAllCredentials()
await sut.retrieveAllCredentials()

// Then
XCTAssertTrue(mockClient.retrieveAllCredentialsCalled)
XCTAssertEqual(sut.credentials.count, 2)
expectation.fulfill()
}
// Then
XCTAssertTrue(mockClient.retrieveAllCredentialsCalled)
XCTAssertEqual(sut.credentials.count, 2)
}
}

0 comments on commit 57470c9

Please sign in to comment.