Skip to content

Commit 5739191

Browse files
Copilothuangyiirene
andcommitted
Add tests for new components
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent 644032e commit 5739191

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { describe, it, expect, beforeAll } from 'vitest';
2+
import { ComponentRegistry } from '@object-ui/core';
3+
4+
describe('New Components Registration', () => {
5+
// Import all renderers to register them
6+
beforeAll(async () => {
7+
await import('./renderers');
8+
});
9+
10+
describe('Form Components', () => {
11+
it('should register date-picker component', () => {
12+
const component = ComponentRegistry.getConfig('date-picker');
13+
expect(component).toBeDefined();
14+
expect(component?.label).toBe('Date Picker');
15+
});
16+
17+
it('should register file-upload component', () => {
18+
const component = ComponentRegistry.getConfig('file-upload');
19+
expect(component).toBeDefined();
20+
expect(component?.label).toBe('File Upload');
21+
});
22+
});
23+
24+
describe('Data Display Components', () => {
25+
it('should register list component', () => {
26+
const component = ComponentRegistry.getConfig('list');
27+
expect(component).toBeDefined();
28+
expect(component?.label).toBe('List');
29+
});
30+
31+
it('should register tree-view component', () => {
32+
const component = ComponentRegistry.getConfig('tree-view');
33+
expect(component).toBeDefined();
34+
expect(component?.label).toBe('Tree View');
35+
});
36+
});
37+
38+
describe('Layout Components', () => {
39+
it('should register grid component', () => {
40+
const component = ComponentRegistry.getConfig('grid');
41+
expect(component).toBeDefined();
42+
expect(component?.label).toBe('Grid Layout');
43+
});
44+
45+
it('should register flex component', () => {
46+
const component = ComponentRegistry.getConfig('flex');
47+
expect(component).toBeDefined();
48+
expect(component?.label).toBe('Flex Layout');
49+
});
50+
51+
it('should register container component', () => {
52+
const component = ComponentRegistry.getConfig('container');
53+
expect(component).toBeDefined();
54+
expect(component?.label).toBe('Container');
55+
});
56+
});
57+
58+
describe('Feedback Components', () => {
59+
it('should register loading component', () => {
60+
const component = ComponentRegistry.getConfig('loading');
61+
expect(component).toBeDefined();
62+
expect(component?.label).toBe('Loading');
63+
});
64+
});
65+
});

0 commit comments

Comments
 (0)