From 81a7bbb075702d608bda23ab1773474053370801 Mon Sep 17 00:00:00 2001 From: Max Chopart Date: Tue, 23 Apr 2024 19:23:24 +0200 Subject: [PATCH] [Fix #193] Mock intl fox question stories --- src/stories/Question.stories.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/stories/Question.stories.tsx b/src/stories/Question.stories.tsx index f509b952..4b7aaa73 100644 --- a/src/stories/Question.stories.tsx +++ b/src/stories/Question.stories.tsx @@ -13,6 +13,7 @@ import question from "./assets/question/question.json"; import answerableQuestion from "./assets/question/answerableQuestion.json"; import answerableQuestionExpanded from "./assets/question/answerableQuestionExpanded.json"; import queryString from "query-string"; +import IntlContextProvider from "../contexts/IntlContextProvider"; export default { title: "Components/Question", @@ -73,6 +74,11 @@ const Template: ComponentStory = ( }; const mapComponent = _getComponentMappingFunction(); const getOptions = (id: number) => options[id] || []; + const Intl = jest.genMockFromModule("react-intl"); // <-- This is the change + + const intl = { + formatMessage: ({ defaultMessage }) => defaultMessage, + }; return ( = ( }} > - {}} /> + {}} intl={intl} /> );