用 Tailwind CSS 重构所有共享组件

This commit is contained in:
雨霖铃
2026-05-22 00:31:52 +08:00
parent 37618eb71f
commit 427e668e7c
20 changed files with 561 additions and 1094 deletions
+5 -3
View File
@@ -334,7 +334,7 @@ describe('TextInputArea 组件', () => {
);
const btn = screen.getByText('主要');
expect(btn).toHaveClass('MuiButton-contained');
expect(btn).toHaveClass('bg-blue-600', 'text-white');
});
});
@@ -346,7 +346,7 @@ describe('TextInputArea 组件', () => {
it('不设置 title 时不渲染标题', () => {
const { container } = render(<TextInputArea value="" onChange={() => {}} />);
expect(container.querySelector('.MuiTypography-body2')).not.toBeInTheDocument();
expect(container.querySelector('.text-gray-500')).not.toBeInTheDocument();
});
});
@@ -507,7 +507,9 @@ describe('TextInputArea 组件', () => {
});
it('应透传 sx 样式', () => {
const { container } = render(<TextInputArea value="" onChange={() => {}} sx={{ mb: 3 }} />);
const { container } = render(
<TextInputArea value="" onChange={() => {}} sx={{ marginBottom: '24px' }} />,
);
expect(container.firstChild).toHaveStyle({ marginBottom: '24px' });
});