Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Pass unit test that previously was failed
Browse files Browse the repository at this point in the history
  • Loading branch information
silviubogan committed Nov 13, 2020
1 parent 60d340a commit 7dd38f8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/blocks/Table/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import '../../editor/plugins/Table/less/public.less';
* @param {object} data The table data to render as a table.
*/
const View = ({ data }) => {
console.log('Rendering Table block view...');
return (
<>
{data && data.table && (
Expand Down
14 changes: 14 additions & 0 deletions src/blocks/Table/View.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ import React from 'react';
import renderer from 'react-test-renderer';
import View from './View';

jest.mock('~/config', () => ({
settings: {
slate: {
elements: {
default: ({ attributes, children }) => (
<p {...attributes}>{children}</p>
),
h2: ({ attributes, children }) => <h2 {...attributes}>{children}</h2>,
},
leafs: {},
},
},
}));

test('renders a view table component', () => {
const component = renderer.create(
<View
Expand Down
32 changes: 14 additions & 18 deletions src/blocks/Table/__snapshots__/View.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders a view table component 1`] = `
<p>
<table
className="ui table"
<table
className="ui table"
>
<tbody
className=""
>
<tbody
<tr
className=""
>
<tr
<td
className=""
>
<td
className=""
>
<h2
id="fgm98"
>
My header
</h2>
</td>
</tr>
</tbody>
</table>
</p>
<h2>
My header
</h2>
</td>
</tr>
</tbody>
</table>
`;
2 changes: 0 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import installTableBlock from './blocks/Table';
import installVoltoProposals from './futurevolto';
import RichTextWidget from './widgets/RichTextWidget';

console.log('Installing Volto Slate...');

export default (config) => {
config = [
installSlate,
Expand Down

0 comments on commit 7dd38f8

Please sign in to comment.