Skip to content

Commit

Permalink
fix: changes test
Browse files Browse the repository at this point in the history
  • Loading branch information
guidari committed Sep 4, 2024
1 parent dc95682 commit 739a40a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/react/src/components/Tag/Tag-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import React from 'react';
import Tag from './';
import DismissibleTag from './DismissibleTag';
import { AILabel } from '../AILabel';
import TagSkeleton from './Tag.Skeleton';

const prefix = 'cds';

describe('Tag', () => {
describe('automated accessibility testing', () => {
Expand Down Expand Up @@ -63,4 +66,13 @@ describe('Tag', () => {
screen.getByRole('button', { name: 'AI - Show information' })
).toBeInTheDocument();
});

it('should render a skeleton state', () => {
const { container } = render(<TagSkeleton />);

// eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
const selectWrapper = container.querySelector(`.${prefix}--tag`);

expect(selectWrapper).toHaveClass(`${prefix}--skeleton`);
});
});
2 changes: 1 addition & 1 deletion packages/react/src/components/Tag/Tag.Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function TagSkeleton({ className, size, ...rest }: TagSkeletonProps) {
`${prefix}--skeleton`,
className,
{
[`${prefix}--tag--${size}`]: size, // TODO: V12 - Remove this class
[`${prefix}--tag--${size}`]: size, // TODO: V12 - Remove this class a
[`${prefix}--layout--size-${size}`]: size,
}
);
Expand Down

0 comments on commit 739a40a

Please sign in to comment.