Skip to content

Commit

Permalink
test fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
phryneas committed Jul 8, 2024
1 parent 6d651c5 commit 03c9739
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/react/hooks/__tests__/useSubscription.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,7 @@ describe("ignoreResults", () => {
error: undefined,
data: undefined,
variables: undefined,
restart: expect.any(Function),
});
link.simulateResult(results[0]);

Expand Down Expand Up @@ -1571,6 +1572,7 @@ describe("ignoreResults", () => {
error: undefined,
data: undefined,
variables: undefined,
restart: expect.any(Function),
});
link.simulateResult(results[0]);

Expand Down Expand Up @@ -1633,6 +1635,7 @@ describe("ignoreResults", () => {
error: undefined,
data: undefined,
variables: undefined,
restart: expect.any(Function),
});
expect(onData).toHaveBeenCalledTimes(0);
}
Expand All @@ -1649,6 +1652,7 @@ describe("ignoreResults", () => {
// `data` appears immediately after changing to `ignoreResults: false`
data: results[0].result.data,
variables: undefined,
restart: expect.any(Function),
});
// `onData` should not be called again for the same result
expect(onData).toHaveBeenCalledTimes(1);
Expand All @@ -1662,6 +1666,7 @@ describe("ignoreResults", () => {
error: undefined,
data: results[1].result.data,
variables: undefined,
restart: expect.any(Function),
});
expect(onData).toHaveBeenCalledTimes(2);
}
Expand Down Expand Up @@ -1699,6 +1704,7 @@ describe("ignoreResults", () => {
error: undefined,
data: undefined,
variables: undefined,
restart: expect.any(Function),
});
expect(onData).toHaveBeenCalledTimes(0);
}
Expand All @@ -1710,6 +1716,7 @@ describe("ignoreResults", () => {
error: undefined,
data: results[0].result.data,
variables: undefined,
restart: expect.any(Function),
});
expect(onData).toHaveBeenCalledTimes(1);
}
Expand All @@ -1724,6 +1731,7 @@ describe("ignoreResults", () => {
// switching back to the default `ignoreResults: true` return value
data: undefined,
variables: undefined,
restart: expect.any(Function),
});
// `onData` should not be called again
expect(onData).toHaveBeenCalledTimes(1);
Expand Down

0 comments on commit 03c9739

Please sign in to comment.