Skip to content

Commit

Permalink
Swap variables used in test for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Dec 5, 2024
1 parent 3c9ce67 commit 2dbaaf6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/__tests__/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3672,7 +3672,7 @@ test("does not return partial cache data when `returnPartialData` is false and n
});

cache.writeQuery({
query: partialQuery,
query,
variables: { id: 1 },
data: {
car: {
Expand All @@ -3685,7 +3685,7 @@ test("does not return partial cache data when `returnPartialData` is false and n
});

cache.writeQuery({
query,
query: partialQuery,
variables: { id: 2 },
data: {
car: {
Expand All @@ -3699,7 +3699,7 @@ test("does not return partial cache data when `returnPartialData` is false and n

const observable = client.watchQuery({
query,
variables: { id: 2 },
variables: { id: 1 },
returnPartialData: false,
notifyOnNetworkStatusChange: true,
});
Expand All @@ -3710,11 +3710,11 @@ test("does not return partial cache data when `returnPartialData` is false and n
loading: false,
networkStatus: NetworkStatus.ready,
data: {
car: { __typename: "Car", id: 2, make: "Ford", model: "Bronco" },
car: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
},
});

await observable.reobserve({ variables: { id: 1 } });
await observable.reobserve({ variables: { id: 2 } });

await expect(stream).toEmitValue({
loading: true,
Expand All @@ -3731,12 +3731,12 @@ test("does not return partial cache data when `returnPartialData` is false and n
await expect(stream).toEmitValue({
loading: false,
networkStatus: NetworkStatus.ready,
data: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
data: { __typename: "Car", id: 2, make: "Ford", model: "Bronco" },
});

expect(observable.getCurrentResult()).toEqual({
loading: false,
networkStatus: NetworkStatus.ready,
data: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
data: { __typename: "Car", id: 2, make: "Ford", model: "Bronco" },
});
});

0 comments on commit 2dbaaf6

Please sign in to comment.