Skip to content

Commit

Permalink
Fix another test
Browse files Browse the repository at this point in the history
  • Loading branch information
Cellule committed Jan 15, 2025
1 parent fb15c99 commit d9cfe5d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/__tests__/dataMasking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,15 @@ describe("client.watchQuery", () => {

const updateQuery: Parameters<typeof observable.updateQuery>[0] = jest.fn(
(previousResult) => {
return { user: { ...previousResult.user, name: "User (updated)" } };
return {
user: {
__typename: "User",
id: 1,
age: 30,
...previousResult?.user,
name: "User (updated)",
},
};
}
);

Expand Down
4 changes: 2 additions & 2 deletions src/react/hooks/__tests__/useBackgroundQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8380,7 +8380,7 @@ describe.skip("type tests", () => {
subscribeToMore({
document: subscription,
updateQuery: (queryData, { subscriptionData }) => {
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData>();
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData | undefined>();
expectTypeOf(queryData).not.toEqualTypeOf<MaskedVariablesCaseData>();

expectTypeOf(
Expand Down Expand Up @@ -8412,7 +8412,7 @@ describe.skip("type tests", () => {
subscribeToMore({
document: subscription,
updateQuery: (queryData, { subscriptionData }) => {
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData>();
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData | undefined>();
expectTypeOf(queryData).not.toEqualTypeOf<MaskedVariablesCaseData>();

expectTypeOf(
Expand Down
4 changes: 2 additions & 2 deletions src/react/hooks/__tests__/useSuspenseQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12905,7 +12905,7 @@ describe("useSuspenseQuery", () => {
subscribeToMore({
document: subscription,
updateQuery: (queryData, { subscriptionData }) => {
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData>();
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData | undefined>();
expectTypeOf(
queryData
).not.toEqualTypeOf<MaskedVariablesCaseData>();
Expand Down Expand Up @@ -12941,7 +12941,7 @@ describe("useSuspenseQuery", () => {
subscribeToMore({
document: subscription,
updateQuery: (queryData, { subscriptionData }) => {
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData>();
expectTypeOf(queryData).toEqualTypeOf<UnmaskedVariablesCaseData | undefined>();
expectTypeOf(
queryData
).not.toEqualTypeOf<MaskedVariablesCaseData>();
Expand Down

0 comments on commit d9cfe5d

Please sign in to comment.