From e416dee87379e248862a8691e6b8b5714ee0101f Mon Sep 17 00:00:00 2001 From: Yann Bertrand <5855339+yannbertrand@users.noreply.github.com> Date: Wed, 12 Jan 2022 11:26:34 +0100 Subject: [PATCH] fix: display hot banner news --- services/document-fetcher.js | 2 +- tests/services/document-fetcher.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/document-fetcher.js b/services/document-fetcher.js index 6f9087194..fb5760955 100644 --- a/services/document-fetcher.js +++ b/services/document-fetcher.js @@ -24,7 +24,7 @@ export function documentFetcher( prismic.predicates.at('document.type', DOCUMENTS.HOT_NEWS), { lang } ) - return documents.results + return documents.results[0] }, findMainNavigation: async () => { const documents = await prismic.api.query( diff --git a/tests/services/document-fetcher.test.js b/tests/services/document-fetcher.test.js index 74385cce6..d91d78e26 100644 --- a/tests/services/document-fetcher.test.js +++ b/tests/services/document-fetcher.test.js @@ -100,7 +100,7 @@ describe('DocumentFetcher', () => { 'document.type', DOCUMENTS.HOT_NEWS ) - expect(response).toEqual(expectedValue) + expect(response).toEqual(expectedValue[0]) }) test('#findMainNavigation', async () => {