Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add test id for accordion trigger #2720

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/roomkit-react/src/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ export const AccordionRoot = StyledAccordion;
export const AccordionItem = StyledItem;

export const AccordionHeader: React.FC<
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS }>
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS; chevronID?: string }>
> = React.forwardRef<
HTMLButtonElement,
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS }>
>(({ children, iconStyles, css, ...props }, forwardedRef) => (
PropsWithChildren<BaseAccordion.AccordionTriggerProps & { iconStyles?: CSS; css?: CSS; chevronID?: string }>
>(({ children, iconStyles, css, chevronID, ...props }, forwardedRef) => (
<StyledHeader css={css}>
<StyledTrigger {...props} ref={forwardedRef}>
{children}
<StyledChevron aria-hidden css={iconStyles} />
<StyledChevron data-testid={chevronID} aria-hidden css={iconStyles} />
</StyledTrigger>
</StyledHeader>
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const RoleAccordion = ({
return (
<Accordion.Item value={roleName} css={{ '&:hover .role_actions': { visibility: 'visible' }, mb: '$8' }} ref={ref}>
<Accordion.Header
chevronID={`role_accordion_btn_${roleName}`}
iconStyles={{ c: '$on_surface_high' }}
css={{
textTransform: 'capitalize',
Expand Down
Loading