Skip to content
Draft
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
17 changes: 16 additions & 1 deletion packages/react/src/AvatarStack/AvatarStack.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,24 @@ const rightAvatarComp = (
describe('AvatarStack', () => {
implementsClassName(AvatarStack, classes.AvatarStack)

describe('AvatarStack data-component attributes', () => {
it('renders AvatarStack with data-component attribute', () => {
const {container} = render(avatarComp)
const root = container.querySelector('[data-component="AvatarStack"]')
expect(root).toBeInTheDocument()
})

it('renders AvatarStack.Body with data-component attribute', () => {
const {container} = render(avatarComp)
const body = container.querySelector('[data-component="AvatarStack.Body"]')
expect(body).toBeInTheDocument()
})
})

it('respects alignRight props', () => {
const {container} = render(rightAvatarComp)
expect(container.firstChild).toMatchSnapshot()
const root = container.querySelector('[data-component="AvatarStack"]')
expect(root).toHaveAttribute('data-align-right', '')
Comment on lines +44 to +45
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already being useful! 😛

})

it('should have a tabindex of 0 if there are no interactive children', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/AvatarStack/AvatarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const AvatarStackBody = ({
} & React.ComponentPropsWithoutRef<'div'>) => {
return (
<div
data-component="AvatarStack.Body"
data-disable-expand={disableExpand ? '' : undefined}
className={clsx(
{
Expand Down Expand Up @@ -158,6 +159,7 @@ const AvatarStack = ({

return (
<span
data-component="AvatarStack"
data-variant={variant}
data-shape={shape}
data-avatar-count={count > 3 ? '3+' : count}
Expand Down

This file was deleted.

Loading