From f5b44cdf3705333ecf282b62406b836b06b74cab Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Sun, 10 Mar 2024 16:19:45 +0100 Subject: [PATCH] Fix module description highlight test --- client/cypress/e2e/frontend/modules/highlights.cy.ts | 1 + client/src/graphql/cache.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/client/cypress/e2e/frontend/modules/highlights.cy.ts b/client/cypress/e2e/frontend/modules/highlights.cy.ts index 1ce882fe..3de87a63 100644 --- a/client/cypress/e2e/frontend/modules/highlights.cy.ts +++ b/client/cypress/e2e/frontend/modules/highlights.cy.ts @@ -13,6 +13,7 @@ const getModule = (contents) => { return { intro: '

Introducing this great paragraph!

', highlights: [], + slug: moduleSlug, chapters: [ { title: 'A Chapter', diff --git a/client/src/graphql/cache.ts b/client/src/graphql/cache.ts index 4195c5de..6acec8eb 100644 --- a/client/src/graphql/cache.ts +++ b/client/src/graphql/cache.ts @@ -53,6 +53,11 @@ const typePolicies = { return previous !== undefined ? previous : false; }, }, + highlights: { + merge(_existing: HighlightNode[], incoming: HighlightNode[]) { + return incoming; + }, + }, }, keyFields: ['slug'], },