Skip to content

Commit

Permalink
test(ui): add Tag test case
Browse files Browse the repository at this point in the history
  • Loading branch information
summericy authored and xiejay97 committed Nov 2, 2023
1 parent 0ee6d77 commit 12122b3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/ui/src/components/tag/Tag.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { render } from '../../__tests__/utils';
import { DTag } from './Tag';

describe('DTag', () => {
it('renders without crashing', () => {
const { container } = render(<DTag>Test Tag</DTag>);
expect(container).toBeInTheDocument();
});

it('renders children correctly', () => {
const { getByText } = render(<DTag>Test Tag</DTag>);
expect(getByText('Test Tag')).toBeInTheDocument();
});

// If you still want to check for basic rendering based on props:
it('renders with correct type', () => {
render(<DTag dType="fill">Fill Tag</DTag>);
// No expect() function here, assuming you only want to check if render() completes without error
});

it('renders with correct theme', () => {
render(<DTag dTheme="primary">Primary Tag</DTag>);
// No expect() function here, assuming you only want to check if render() completes without error
});

it('renders with correct size', () => {
render(<DTag dSize="sm">Small Tag</DTag>);
// No expect() function here, assuming you only want to check if render() completes without error
});
});

0 comments on commit 12122b3

Please sign in to comment.