Skip to content

Commit

Permalink
Propage data-testid to Breadcrumbs (#4542)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasSlama authored Sep 11, 2024
1 parent cd9c86c commit 0da0237
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/pretty-toes-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@toptal/picasso-breadcrumbs': patch
'@toptal/picasso': patch
---

### Breadcrumbs

- propage `data-testid`
9 changes: 7 additions & 2 deletions packages/base/Breadcrumbs/src/Breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ export interface Props extends BaseProps {

export const Breadcrumbs = forwardRef<HTMLDivElement, Props>(
function Breadcrumbs(props, ref) {
const { children } = props
const { children, 'data-testid': dataTestId } = props

const allItems = React.Children.map(children, child => (
<li className='p-0 m-0'>{child}</li>
))

return (
<Typography as='nav' ref={ref} className='text-md text-black/[.54]'>
<Typography
as='nav'
ref={ref}
className='text-md text-black/[.54]'
data-testid={dataTestId}
>
<ol className='flex flex-wrap items-center p-0 m-0 list-none'>
{allItems && insertSeparator(allItems)}
</ol>
Expand Down

0 comments on commit 0da0237

Please sign in to comment.