Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snapshot test about MoreMenu component #7338

Merged
merged 2 commits into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ This list is manually curated to include valuable contributions by volunteers th
| @nfmohit-wpmudev |
| @noisysocks | @noisysocks |
| @omarreiss | @omarreiss |
| @hedgefield | @hedgefield |
| @hedgefield | @hedgefield |
| @hideokamoto | @hideokamoto |
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`MoreMenu should match snapshot 1`] = `
<MoreMenu>
<Dropdown
className="edit-post-more-menu"
position="bottom left"
renderContent={[Function]}
renderToggle={[Function]}
>
<div
className="edit-post-more-menu"
>
<div>
<IconButton
aria-expanded={false}
icon="ellipsis"
label="More"
onClick={[Function]}
>
<Tooltip
text="More"
>
<Button
aria-expanded={false}
aria-label="More"
className="components-icon-button"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
>
<button
aria-expanded={false}
aria-label="More"
className="components-button components-icon-button"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
type="button"
>
<Dashicon
icon="ellipsis"
key="0,0"
>
<svg
aria-hidden={true}
className="dashicon dashicons-ellipsis"
focusable="false"
height={20}
role="img"
viewBox="0 0 20 20"
width={20}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
/>
</svg>
</Dashicon>
</button>
</Button>
</Tooltip>
</IconButton>
</div>
</div>
</Dropdown>
</MoreMenu>
`;
19 changes: 19 additions & 0 deletions edit-post/components/header/more-menu/test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* External dependencies
*/
import { mount } from 'enzyme';

/**
* Internal dependencies
*/
import MoreMenu from '../index';

describe( 'MoreMenu', () => {
it( 'should match snapshot', () => {
const wrapper = mount(
<MoreMenu />
);

expect( wrapper ).toMatchSnapshot();
} );
} );