Skip to content

Commit

Permalink
Add snapshot test about MoreMenu component (#7338)
Browse files Browse the repository at this point in the history
* add snapshot test about edit-post/components/header/more-menu component

* fix test code to allow lint style
  • Loading branch information
hideokamoto authored and gziolo committed Jun 20, 2018
1 parent 6bf15a3 commit 81ba212
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 1 deletion.
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="https://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();
} );
} );

0 comments on commit 81ba212

Please sign in to comment.