From 29343c12134080f2ee9e0d766e93b5d66ebbdc71 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 12 Feb 2024 11:53:06 -0700 Subject: [PATCH] Test calls to getCurrentResult as well --- src/core/__tests__/ObservableQuery.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/__tests__/ObservableQuery.ts b/src/core/__tests__/ObservableQuery.ts index b75d248dfc8..acb57833b5e 100644 --- a/src/core/__tests__/ObservableQuery.ts +++ b/src/core/__tests__/ObservableQuery.ts @@ -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" }, + }); });