1
0

refactor: 迁移 UI 组件库从 Ant Design 至 TDesign

- 替换 antd 为 tdesign-react 作为主要 UI 组件库
- 引入 Recharts 替代 @ant-design/charts 实现图表功能
- 移除主题系统相关代码(ThemeContext、themes 目录)
- 更新所有组件以适配 TDesign 组件 API
- 更新测试用例以匹配新的组件实现
- 新增 TDesign 和 Recharts 集成规范文档
This commit is contained in:
2026-04-17 18:22:13 +08:00
parent 6eeb38c15e
commit 2b1c5e96c3
55 changed files with 1622 additions and 2541 deletions

View File

@@ -22,7 +22,12 @@ const defaultProps = {
};
function getDialog() {
return screen.getByRole('dialog');
// TDesign Dialog doesn't have role="dialog", use class selector
const dialog = document.querySelector('.t-dialog');
if (!dialog) {
throw new Error('Dialog not found');
}
return dialog;
}
describe('ProviderForm', () => {
@@ -122,7 +127,8 @@ describe('ProviderForm', () => {
render(<ProviderForm {...defaultProps} loading={true} />);
const dialog = getDialog();
const okButton = within(dialog).getByRole('button', { name: /保/ });
expect(okButton).toHaveClass('ant-btn-loading');
// TDesign uses t-is-loading class for loading state
expect(okButton).toHaveClass('t-is-loading');
});
it('shows validation error for invalid URL format', async () => {