-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(TableToolbarMenu): update tests to RTL (#13172)
* test(TableToolbarMenu): update tests to RTL * Update TableToolbarMenu-test.js.snap * chore: fix merge conflicts --------- Co-authored-by: Alessandra Davila <adavila91@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
9e4f0fa
commit 5024767
Showing
2 changed files
with
90 additions
and
215 deletions.
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
232 changes: 45 additions & 187 deletions
232
...ages/react/src/components/DataTable/__tests__/__snapshots__/TableToolbarMenu-test.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,196 +1,54 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DataTable.TableToolbarMenu should render 1`] = ` | ||
<TableToolbarMenu | ||
className="custom-class" | ||
iconDescription="Add" | ||
renderIcon={ | ||
Object { | ||
"$$typeof": Symbol(react.forward_ref), | ||
"propTypes": Object { | ||
"size": [Function], | ||
}, | ||
"render": [Function], | ||
} | ||
} | ||
> | ||
<ClassWrapper(OverflowMenu) | ||
ariaLabel="Add" | ||
className="custom-class cds--toolbar-action cds--overflow-menu" | ||
flipped={true} | ||
iconDescription="Add" | ||
renderIcon={ | ||
Object { | ||
"$$typeof": Symbol(react.forward_ref), | ||
"propTypes": Object { | ||
"size": [Function], | ||
}, | ||
"render": [Function], | ||
} | ||
} | ||
title="Add" | ||
exports[`TableToolbarMenu renders as expected - Component API should render 1`] = ` | ||
<div> | ||
<span | ||
class="cds--overflow-menu__wrapper" | ||
> | ||
<OverflowMenu | ||
ariaLabel="Add" | ||
className="custom-class cds--toolbar-action cds--overflow-menu" | ||
direction="bottom" | ||
flipped={true} | ||
focusTrap={true} | ||
iconDescription="Add" | ||
menuOffset={[Function]} | ||
menuOffsetFlip={[Function]} | ||
onClick={[Function]} | ||
onClose={[Function]} | ||
onKeyDown={[Function]} | ||
onOpen={[Function]} | ||
open={false} | ||
renderIcon={ | ||
Object { | ||
"$$typeof": Symbol(react.forward_ref), | ||
"propTypes": Object { | ||
"size": [Function], | ||
}, | ||
"render": [Function], | ||
} | ||
} | ||
selectorPrimaryFocus="[data-overflow-menu-primary-focus]" | ||
title="Add" | ||
<span | ||
class="cds--popover-container cds--popover--caret cds--popover--high-contrast cds--popover--top cds--tooltip cds--icon-tooltip" | ||
> | ||
<ClickListener | ||
onClickOutside={[Function]} | ||
<button | ||
aria-expanded="false" | ||
aria-haspopup="true" | ||
aria-labelledby="tooltip-2" | ||
class="cds--btn--icon-only custom-class cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md cds--btn cds--btn--md cds--btn--primary" | ||
title="Add" | ||
type="button" | ||
> | ||
<svg | ||
aria-label="Add" | ||
class="cds--overflow-menu__icon" | ||
fill="currentColor" | ||
focusable="false" | ||
height="16" | ||
preserveAspectRatio="xMidYMid meet" | ||
role="img" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M13 7L12.3 6.3 8.5 10.1 8.5 1 7.5 1 7.5 10.1 3.7 6.3 3 7 8 12zM13 12v2H3v-2H2v2l0 0c0 .6.4 1 1 1h10c.6 0 1-.4 1-1l0 0v-2H13z" | ||
/> | ||
</svg> | ||
</button> | ||
<span | ||
aria-hidden="true" | ||
class="cds--popover" | ||
id="tooltip-2" | ||
role="tooltip" | ||
> | ||
<span | ||
className="cds--overflow-menu__wrapper" | ||
class="cds--popover-content cds--tooltip-content" | ||
> | ||
<ForwardRef(IconButton) | ||
aria-expanded={false} | ||
aria-haspopup={true} | ||
className="custom-class cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md" | ||
label="Add" | ||
onClick={[Function]} | ||
onClose={[Function]} | ||
onKeyDown={[Function]} | ||
open={false} | ||
title="Add" | ||
type="button" | ||
> | ||
<Tooltip | ||
className="cds--icon-tooltip" | ||
closeOnActivation={true} | ||
defaultOpen={false} | ||
label="Add" | ||
> | ||
<Popover | ||
align="top" | ||
className="cds--tooltip cds--icon-tooltip" | ||
dropShadow={false} | ||
highContrast={true} | ||
onKeyDown={[Function]} | ||
onMouseLeave={[Function]} | ||
open={false} | ||
> | ||
<span | ||
className="cds--popover-container cds--popover--caret cds--popover--high-contrast cds--popover--top cds--tooltip cds--icon-tooltip" | ||
onKeyDown={[Function]} | ||
onMouseLeave={[Function]} | ||
> | ||
<Button | ||
aria-expanded={false} | ||
aria-haspopup={true} | ||
aria-labelledby="tooltip-2" | ||
className="cds--btn--icon-only custom-class cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md" | ||
onBlur={[Function]} | ||
onClick={[Function]} | ||
onClose={[Function]} | ||
onFocus={[Function]} | ||
onKeyDown={[Function]} | ||
onMouseEnter={[Function]} | ||
open={false} | ||
size="md" | ||
title="Add" | ||
type="button" | ||
> | ||
<button | ||
aria-describedby={null} | ||
aria-expanded={false} | ||
aria-haspopup={true} | ||
aria-labelledby="tooltip-2" | ||
aria-pressed={null} | ||
className="cds--btn--icon-only custom-class cds--toolbar-action cds--overflow-menu cds--overflow-menu cds--overflow-menu--md cds--btn cds--btn--md cds--btn--primary" | ||
disabled={false} | ||
onBlur={[Function]} | ||
onClick={[Function]} | ||
onClose={[Function]} | ||
onFocus={[Function]} | ||
onKeyDown={[Function]} | ||
onMouseEnter={[Function]} | ||
open={false} | ||
title="Add" | ||
type="button" | ||
> | ||
<ForwardRef(Download) | ||
aria-label="Add" | ||
className="cds--overflow-menu__icon" | ||
> | ||
<Icon | ||
aria-label="Add" | ||
className="cds--overflow-menu__icon" | ||
fill="currentColor" | ||
height={16} | ||
preserveAspectRatio="xMidYMid meet" | ||
viewBox="0 0 16 16" | ||
width={16} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<svg | ||
aria-label="Add" | ||
className="cds--overflow-menu__icon" | ||
fill="currentColor" | ||
focusable="false" | ||
height={16} | ||
preserveAspectRatio="xMidYMid meet" | ||
role="img" | ||
viewBox="0 0 16 16" | ||
width={16} | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M13 7L12.3 6.3 8.5 10.1 8.5 1 7.5 1 7.5 10.1 3.7 6.3 3 7 8 12zM13 12v2H3v-2H2v2l0 0c0 .6.4 1 1 1h10c.6 0 1-.4 1-1l0 0v-2H13z" | ||
/> | ||
</svg> | ||
</Icon> | ||
</ForwardRef(Download)> | ||
</button> | ||
</Button> | ||
<ForwardRef(PopoverContent) | ||
aria-hidden="true" | ||
className="cds--tooltip-content" | ||
id="tooltip-2" | ||
role="tooltip" | ||
> | ||
<span | ||
aria-hidden="true" | ||
className="cds--popover" | ||
id="tooltip-2" | ||
role="tooltip" | ||
> | ||
<span | ||
className="cds--popover-content cds--tooltip-content" | ||
> | ||
Add | ||
</span> | ||
<span | ||
className="cds--popover-caret" | ||
/> | ||
</span> | ||
</ForwardRef(PopoverContent)> | ||
</span> | ||
</Popover> | ||
</Tooltip> | ||
</ForwardRef(IconButton)> | ||
Add | ||
</span> | ||
</ClickListener> | ||
</OverflowMenu> | ||
</ClassWrapper(OverflowMenu)> | ||
</TableToolbarMenu> | ||
<span | ||
class="cds--popover-caret" | ||
/> | ||
</span> | ||
</span> | ||
</span> | ||
</div> | ||
`; |