From b0a07bd8194c1ee53ef9d553ae8127b9881d6e59 Mon Sep 17 00:00:00 2001 From: ana-oprea Date: Thu, 15 Jun 2023 12:18:29 +0300 Subject: [PATCH 1/3] test: add unit tests for helpers and DefaultQuote - refs #253277 --- .../Quote/variations/DefaultQuote.test.jsx | 82 +++++++++ src/helpers.test.js | 172 ++++++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 src/Blocks/Quote/variations/DefaultQuote.test.jsx create mode 100644 src/helpers.test.js diff --git a/src/Blocks/Quote/variations/DefaultQuote.test.jsx b/src/Blocks/Quote/variations/DefaultQuote.test.jsx new file mode 100644 index 0000000..209fbac --- /dev/null +++ b/src/Blocks/Quote/variations/DefaultQuote.test.jsx @@ -0,0 +1,82 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import { Provider } from 'react-redux'; +import configureStore from 'redux-mock-store'; +import Quote from './DefaultQuote'; +import '@testing-library/jest-dom/extend-expect'; + +const mockStore = configureStore([]); + +jest.mock('@plone/volto/registry', () => ({ + settings: { + slate: { + defaultValue: jest.fn(() => 'default value'), + }, + }, +})); + +jest.mock('@plone/volto-slate/editor/SlateEditor', () => () =>