Skip to content

Commit

Permalink
fix: add test id for accordion trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Mar 19, 2024
1 parent 0d6968f commit c062d6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit c062d6b

Please sign in to comment.