Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ui): add Tag test case #285

Merged
merged 1 commit into from
Nov 2, 2023
Merged
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
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
});
});
Loading