Skip to content

Commit 32a3bac

Browse files
committed
Test calls to getCurrentResult as well
1 parent da339ae commit 32a3bac

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/core/__tests__/ObservableQuery.ts

+12
Original file line numberDiff line numberDiff line change
@@ -3566,9 +3566,21 @@ test("does not return partial cache data when `returnPartialData` is false and n
35663566
data: undefined,
35673567
});
35683568

3569+
expect(observable.getCurrentResult()).toEqual({
3570+
loading: true,
3571+
networkStatus: NetworkStatus.setVariables,
3572+
data: undefined,
3573+
});
3574+
35693575
expect(await stream.takeNext()).toEqual({
35703576
loading: false,
35713577
networkStatus: NetworkStatus.ready,
35723578
data: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
35733579
});
3580+
3581+
expect(observable.getCurrentResult()).toEqual({
3582+
loading: false,
3583+
networkStatus: NetworkStatus.ready,
3584+
data: { __typename: "Car", id: 1, make: "Ford", model: "Pinto" },
3585+
});
35743586
});

0 commit comments

Comments
 (0)