From 12122b336e44bd553b72188bcc4e14fbdceec2d1 Mon Sep 17 00:00:00 2001
From: summericy <671412430@qq.com>
Date: Wed, 1 Nov 2023 20:07:38 +0800
Subject: [PATCH] test(ui): add Tag test case
---
packages/ui/src/components/tag/Tag.test.tsx | 30 +++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 packages/ui/src/components/tag/Tag.test.tsx
diff --git a/packages/ui/src/components/tag/Tag.test.tsx b/packages/ui/src/components/tag/Tag.test.tsx
new file mode 100644
index 00000000..481f8b4f
--- /dev/null
+++ b/packages/ui/src/components/tag/Tag.test.tsx
@@ -0,0 +1,30 @@
+import { render } from '../../__tests__/utils';
+import { DTag } from './Tag';
+
+describe('DTag', () => {
+ it('renders without crashing', () => {
+ const { container } = render(Test Tag);
+ expect(container).toBeInTheDocument();
+ });
+
+ it('renders children correctly', () => {
+ const { getByText } = render(Test Tag);
+ expect(getByText('Test Tag')).toBeInTheDocument();
+ });
+
+ // If you still want to check for basic rendering based on props:
+ it('renders with correct type', () => {
+ render(Fill Tag);
+ // No expect() function here, assuming you only want to check if render() completes without error
+ });
+
+ it('renders with correct theme', () => {
+ render(Primary Tag);
+ // No expect() function here, assuming you only want to check if render() completes without error
+ });
+
+ it('renders with correct size', () => {
+ render(Small Tag);
+ // No expect() function here, assuming you only want to check if render() completes without error
+ });
+});