From 603ece466dabc18fe564bfc4870a4fe2e709a837 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Thu, 4 Apr 2024 16:59:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=A1(app-impress)=20mock=20BlockNoteEdi?= =?UTF-8?q?tor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BlockNoteEditor uses many libraries not compatible with Jest. This commit mocks the BlockNoteEditor component to allow Jest to run without errors. --- src/frontend/apps/impress/jest.config.ts | 1 + src/frontend/apps/impress/jest/mocks/ComponentMock.js | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 src/frontend/apps/impress/jest/mocks/ComponentMock.js diff --git a/src/frontend/apps/impress/jest.config.ts b/src/frontend/apps/impress/jest.config.ts index e77e0b1a..804c4fce 100644 --- a/src/frontend/apps/impress/jest.config.ts +++ b/src/frontend/apps/impress/jest.config.ts @@ -22,6 +22,7 @@ const jestConfig = async () => { moduleNameMapper: { '\\.svg$': '/jest/mocks/svg.js', '^.+\\.svg\\?url$': `/jest/mocks/fileMock.js`, + BlockNoteEditor: `/jest/mocks/ComponentMock.js`, ...nextJestConfig.moduleNameMapper, }, }; diff --git a/src/frontend/apps/impress/jest/mocks/ComponentMock.js b/src/frontend/apps/impress/jest/mocks/ComponentMock.js new file mode 100644 index 00000000..812a08b1 --- /dev/null +++ b/src/frontend/apps/impress/jest/mocks/ComponentMock.js @@ -0,0 +1,5 @@ +import React from 'react'; + +export const ComponentMock = () => { + return
My component mocked
; +};