Skip to content

Commit

Permalink
fix(test): increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Sep 1, 2023
1 parent ac76d57 commit 1c8a1f7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Block/HorizontalMenu.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import renderer from 'react-test-renderer';
import HorizontalMenu from './HorizontalMenu';

jest.mock('react-intl', () => ({
injectIntl: jest.fn((Component) => Component),
}));

describe('HorizontalMenu', () => {
it('renders correctly', () => {
const component = renderer.create(
<HorizontalMenu properties={{}} data={{ title: 'Heading title' }} />,
);
const json = component.toJSON();
expect(json).toMatchSnapshot();
expect(component).toMatchSnapshot();
});
});
45 changes: 45 additions & 0 deletions src/Block/__snapshots__/HorizontalMenu.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HorizontalMenu renders correctly 1`] = `
Array [
<h2>
Heading title
</h2>,
<div
className=""
>
<div
style={Object {}}
/>
<div
className="ui sticky"
>
<div
className="ui menu"
/>
</div>
</div>,
]
`;

exports[`HorizontalMenu renders correctly 2`] = `
Array [
<h2>
Heading title
</h2>,
<div
className=""
>
<div
style={Object {}}
/>
<div
className="ui sticky"
>
<div
className="ui menu"
/>
</div>
</div>,
]
`;

0 comments on commit 1c8a1f7

Please sign in to comment.