Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico authored and wesleybl committed Jul 7, 2023
1 parent 76e2ed0 commit 826483f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/RichTextEditor/ToHTML.jsx
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
20 changes: 20 additions & 0 deletions test-setup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => (
<h2 id={keys[i]} key={keys[i]}>
{child}
</h2>
)),
},
entities: null,
},
// ToHTMLOptions,
};

config.set('settings', {
apiPath: 'http://localhost:8080/Plone',
defaultLanguage: 'en',
Expand All @@ -52,6 +71,7 @@ config.set('settings', {
isMultilingual: false,
nonContentRoutes,
richtextEditorSettings,
richtextViewSettings,
contentIcons: contentIcons,
loadables,
lazyBundles: {
Expand Down

0 comments on commit 826483f

Please sign in to comment.