Skip to content

Commit

Permalink
Test calls to getCurrentResult as well
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Dec 5, 2024
1 parent 2d3f8da commit 29343c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/__tests__/ObservableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3722,9 +3722,21 @@ test("does not return partial cache data when `returnPartialData` is false and n
data: undefined,
});

expect(observable.getCurrentResult()).toEqual({
loading: true,
networkStatus: NetworkStatus.setVariables,
data: undefined,
});

expect(await stream.takeNext()).toEqual({
loading: false,
networkStatus: NetworkStatus.ready,
data: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
});

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

0 comments on commit 29343c1

Please sign in to comment.