Skip to content

Commit

Permalink
revert action change
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Nov 13, 2023
1 parent b70387f commit 2aac662
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
10 changes: 3 additions & 7 deletions packages/react-core/src/components/DataList/DataListAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,15 @@ export const DataListAction: React.FunctionComponent<DataListActionProps> = ({
children,
className,
visibility,
/* eslint-disable @typescript-eslint/no-unused-vars */
id,
'aria-label': ariaLabel,
'aria-labelledby': ariaLabelledBy,
/* eslint-disable @typescript-eslint/no-unused-vars */
isPlainButtonAction,
...props
}: DataListActionProps) => (
<div
className={css(styles.dataListItemAction, formatBreakpointMods(visibility, styles), className)}
id={id}
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
{...props}
>
<div className={css(styles.dataListItemAction, formatBreakpointMods(visibility, styles), className)} {...props}>
{isPlainButtonAction ? <div className={css(styles.dataListAction)}>{children}</div> : children}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,3 @@ test(`Renders with class ${styles.dataListAction} when isPlainButtonAction = tru
expect(screen.getByText('test')).toHaveClass(styles.modifiers[`${visMod}On_2xl`]);
});
});

test(`Renders with aria-label when aria-label is passed`, () => {
render(
<DataListAction aria-label="Actions" aria-labelledby="ex-action" id="ex-action">
test
</DataListAction>
);
expect(screen.getByText('test')).toHaveAccessibleName('Actions');
});

test(`Renders with aria-labelledby when aria-label is passed`, () => {
render(
<DataListAction aria-label="Actions" aria-labelledby="ex-action" id="ex-action">
test
</DataListAction>
);
expect(screen.getByText('test')).toHaveAttribute('aria-labelledby', 'ex-action');
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
exports[`DataListAction should match snapshot (auto-generated) 1`] = `
<DocumentFragment>
<div
aria-label="string"
aria-labelledby="string"
class="pf-v5-c-data-list__item-action ''"
id="string"
>
<div>
ReactNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
exports[`Renders to match snapshot 1`] = `
<DocumentFragment>
<div
aria-label="Actions"
aria-labelledby="ex-action"
class="pf-v5-c-data-list__item-action"
id="ex-action"
>
test
</div>
Expand Down

0 comments on commit 2aac662

Please sign in to comment.