-
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.
Block Editor: Refactor BlockVerticalAlignmentUI tests to @testing-lib…
…rary/react (#44029)
- Loading branch information
Showing
3 changed files
with
186 additions
and
76 deletions.
There are no files selected for viewing
142 changes: 91 additions & 51 deletions
142
...k-editor/src/components/block-vertical-alignment-control/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 |
---|---|---|
@@ -1,69 +1,109 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BlockVerticalAlignmentUI should match snapshot 1`] = ` | ||
<ToolbarGroup | ||
controls={ | ||
Array [ | ||
Object { | ||
"icon": <SVG | ||
exports[`BlockVerticalAlignmentUI should match snapshot when controls are hidden 1`] = ` | ||
<div> | ||
<div | ||
class="components-dropdown components-dropdown-menu components-toolbar" | ||
tabindex="-1" | ||
> | ||
<button | ||
aria-expanded="false" | ||
aria-haspopup="true" | ||
aria-label="Change vertical alignment" | ||
class="components-button components-dropdown-menu__toggle has-icon" | ||
data-toolbar-item="true" | ||
type="button" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
focusable="false" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M9 20h6V9H9v11zM4 4v1.5h16V4H4z" | ||
/> | ||
</svg> | ||
</button> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`BlockVerticalAlignmentUI should match snapshot when controls are visible 1`] = ` | ||
<div> | ||
<div | ||
class="components-toolbar" | ||
icon="[object Object]" | ||
label="Change vertical alignment" | ||
> | ||
<div> | ||
<button | ||
aria-label="Align top" | ||
aria-pressed="true" | ||
class="components-button components-toolbar__control is-pressed has-icon" | ||
data-toolbar-item="true" | ||
type="button" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
focusable="false" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<Path | ||
<path | ||
d="M9 20h6V9H9v11zM4 4v1.5h16V4H4z" | ||
/> | ||
</SVG>, | ||
"isActive": true, | ||
"onClick": [Function], | ||
"role": "menuitemradio", | ||
"title": "Align top", | ||
}, | ||
Object { | ||
"icon": <SVG | ||
</svg> | ||
</button> | ||
</div> | ||
<div> | ||
<button | ||
aria-label="Align middle" | ||
aria-pressed="false" | ||
class="components-button components-toolbar__control has-icon" | ||
data-toolbar-item="true" | ||
type="button" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
focusable="false" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<Path | ||
<path | ||
d="M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" | ||
/> | ||
</SVG>, | ||
"isActive": false, | ||
"onClick": [Function], | ||
"role": "menuitemradio", | ||
"title": "Align middle", | ||
}, | ||
Object { | ||
"icon": <SVG | ||
</svg> | ||
</button> | ||
</div> | ||
<div> | ||
<button | ||
aria-label="Align bottom" | ||
aria-pressed="false" | ||
class="components-button components-toolbar__control has-icon" | ||
data-toolbar-item="true" | ||
type="button" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
focusable="false" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
width="24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<Path | ||
<path | ||
d="M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" | ||
/> | ||
</SVG>, | ||
"isActive": false, | ||
"onClick": [Function], | ||
"role": "menuitemradio", | ||
"title": "Align bottom", | ||
}, | ||
] | ||
} | ||
icon={ | ||
<SVG | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<Path | ||
d="M9 20h6V9H9v11zM4 4v1.5h16V4H4z" | ||
/> | ||
</SVG> | ||
} | ||
isCollapsed={true} | ||
label="Change vertical alignment" | ||
popoverProps={ | ||
Object { | ||
"isAlternate": true, | ||
} | ||
} | ||
/> | ||
</svg> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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
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