Skip to content

Commit

Permalink
Add test checking that __typename checks update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Aug 30, 2023
1 parent bda5735 commit f42b1c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exchanges/graphcache/src/store/data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('garbage collection', () => {
it('erases orphaned entities', () => {
InMemoryData.writeRecord('Todo:1', '__typename', 'Todo');
InMemoryData.writeRecord('Todo:1', 'id', '1');
InMemoryData.writeRecord('Todo:2', '__typename', 'Todo');
InMemoryData.writeRecord('Query', '__typename', 'Query');
InMemoryData.writeLink('Query', 'todo', 'Todo:1');

Expand All @@ -27,7 +28,7 @@ describe('garbage collection', () => {
expect(InMemoryData.readRecord('Todo:1', 'id')).toBe(undefined);

expect(InMemoryData.getCurrentDependencies()).toEqual(
new Set(['Todo:1', 'Query.todo'])
new Set(['Todo:1', 'Todo:2', 'Query.todo'])
);
});

Expand Down

0 comments on commit f42b1c8

Please sign in to comment.