Skip to content

Commit

Permalink
Test full cache.extract() at end of test.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Mar 8, 2023
1 parent f09f09f commit 777623f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/cache/inmemory/__tests__/policies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,50 @@ describe("type policies", function () {
{ __typename: "ManagerEntity", uid: "vbnm", name: "Hugh" },
],
});

expect(cache.extract()).toEqual({
ROOT_QUERY: {
__typename: "Query",
coworkers: [
{ __ref: 'CoworkerEntity:{"uid":"qwer"}' },
{ __ref: 'CoworkerEntity:{"uid":"asdf"}' },
{ __ref: 'CoworkerEntity:{"uid":"zxcv"}' },
{ __ref: 'ManagerEntity:{"uid":"uiop"}' },
{ __ref: 'CoworkerEntity:{"uid":"hjkl"}' },
{ __ref: 'ManagerEntity:{"uid":"vbnm"}' },
],
},
'CoworkerEntity:{"uid":"qwer"}': {
__typename: "CoworkerEntity",
uid: "qwer",
name: "Alessia",
},
'CoworkerEntity:{"uid":"asdf"}': {
__typename: "CoworkerEntity",
uid: "asdf",
name: "Jerel",
},
'CoworkerEntity:{"uid":"zxcv"}': {
__typename: "CoworkerEntity",
uid: "zxcv",
name: "Lenz",
},
'ManagerEntity:{"uid":"uiop"}': {
__typename: "ManagerEntity",
uid: "uiop",
name: "Jeff",
},
'CoworkerEntity:{"uid":"hjkl"}': {
__typename: "CoworkerEntity",
uid: "hjkl",
name: "Martijn",
},
'ManagerEntity:{"uid":"vbnm"}': {
__typename: "ManagerEntity",
uid: "vbnm",
name: "Hugh",
},
});
});

describe("field policies", function () {
Expand Down

0 comments on commit 777623f

Please sign in to comment.