Skip to content

Commit

Permalink
Change test to handle missing id case
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Oct 16, 2024
1 parent 079d1bd commit e9ec645
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/ApolloTests/WebSocket/WebSocketTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class WebSocketTests: XCTestCase {
subject.cancel()
}

func testLocalErrorUnknownId() throws {
let expectation = self.expectation(description: "Unknown id for subscription")
func testLocalErrorMissingId() throws {
let expectation = self.expectation(description: "Missing id for subscription")

let subject = client.subscribe(subscription: MockSubscription<ReviewAddedData>()) { result in
defer { expectation.fulfill() }
Expand All @@ -133,10 +133,10 @@ class WebSocketTests: XCTestCase {
}
}
}


// Message data below has missing 'id' and should notify all subscribers of the error
let message : JSONEncodableDictionary = [
"type": "data",
"id": "2", // subscribing on id = 1, i.e. expecting error when receiving id = 2
"payload": [
"data": [
"reviewAdded": [
Expand Down

0 comments on commit e9ec645

Please sign in to comment.