-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add snapshot test about
MoreMenu
component (#7338)
* add snapshot test about edit-post/components/header/more-menu component * fix test code to allow lint style
- Loading branch information
1 parent
6bf15a3
commit 81ba212
Showing
3 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
edit-post/components/header/more-menu/test/__snapshots__/index.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} ); | ||
} ); |