From 826483faec8e813bcfe59bd9b5a3085f46a57379 Mon Sep 17 00:00:00 2001 From: mamico Date: Sun, 11 Sep 2022 23:28:49 +0200 Subject: [PATCH] fix tests --- src/config/RichTextEditor/ToHTML.jsx | 2 +- test-setup-config.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/config/RichTextEditor/ToHTML.jsx b/src/config/RichTextEditor/ToHTML.jsx index 663e43a68e8..f89b59be1d7 100644 --- a/src/config/RichTextEditor/ToHTML.jsx +++ b/src/config/RichTextEditor/ToHTML.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { isEmpty } from 'lodash'; -import { UniversalLink, Image } from '@plone/volto/components'; +import { Image, UniversalLink } from '@plone/volto/components'; const styles = { code: { diff --git a/test-setup-config.js b/test-setup-config.js index 583d6a431f3..243eef33559 100644 --- a/test-setup-config.js +++ b/test-setup-config.js @@ -44,6 +44,25 @@ const richtextEditorSettings = (props) => { }; }; +// we need to do a redefinition here because of circular import issues +// because draftjs-based components are not really tested, this is basically +// dummy code. +const richtextViewSettings = { + ToHTMLRenderers: { + inline: null, + blocks: { + 'header-two': (children, { keys }) => + children.map((child, i) => ( +

+ {child} +

+ )), + }, + entities: null, + }, + // ToHTMLOptions, +}; + config.set('settings', { apiPath: 'http://localhost:8080/Plone', defaultLanguage: 'en', @@ -52,6 +71,7 @@ config.set('settings', { isMultilingual: false, nonContentRoutes, richtextEditorSettings, + richtextViewSettings, contentIcons: contentIcons, loadables, lazyBundles: {