Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 273190e

Browse files
authored
Merge pull request #607 from wordpress-mobile/fix/flaky-sharing-service-test
Fix flaky SharingServiceRemoteTests test
2 parents 9c000f3 + 2244ce6 commit 273190e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

WordPressKitTests/SharingServiceRemoteTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ final class SharingServiceRemoteTests: RemoteTestCase, RESTTestable {
3939
stubRemoteResponse(pathToStub, filename: publicizeServicesMockFilename, contentType: .ApplicationJSON)
4040

4141
mockService.getPublicizeServices(for: mockID) { publicizeServices in
42-
guard let firstService = publicizeServices.first else {
42+
guard let facebookService = publicizeServices.first(where: { $0.serviceID == "facebook" }) else {
4343
XCTFail("Expected a RemotePublicizeService to exist")
4444
return
4545
}
46-
XCTAssertTrue(firstService.status.isEmpty)
46+
XCTAssertTrue(facebookService.status.isEmpty)
4747

48-
guard let secondService = publicizeServices.last else {
48+
guard let twitterService = publicizeServices.first(where: { $0.serviceID == "twitter"}) else {
4949
XCTFail("Expected a RemotePublicizeService to exist")
5050
return
5151
}
52-
XCTAssertEqual(secondService.status, "unsupported")
52+
XCTAssertEqual(twitterService.status, "unsupported")
5353

5454
expectation.fulfill()
5555

0 commit comments

Comments
 (0)