Files
testing-tool/src/components/__tests__/PageSkeleton.test.tsx
T
rsgltzyd 9aa7a51f0b refactor: 移除 Dashboard 页面及相关功能,更新路由和组件逻辑
- 移除 Dashboard 相关的组件、特性和测试代码,简化项目结构。
- 更新 PageSkeleton 组件,默认渲染工具页面骨架。
- 修改 RouterContainer 和 RouterProvider 以适应新的默认路由策略,确保用户直接访问 timestamp 页面。
- 更新测试用例,确保在新结构下的功能正常。
2026-07-05 22:02:25 +08:00

33 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { render } from '@testing-library/react';
import PageSkeleton from '@/components/PageSkeleton';
describe('PageSkeleton 组件', () => {
describe('渲染测试', () => {
it('应渲染工具页面骨架', () => {
const { container } = render(<PageSkeleton />);
const skeletons = container.querySelectorAll('.animate-pulse');
expect(skeletons.length).toBeGreaterThan(0);
});
});
describe('布局结构测试', () => {
it('工具骨架屏应有内边距', () => {
const { container } = render(<PageSkeleton />);
const toolContainer = container.firstChild as HTMLElement;
expect(toolContainer).toHaveClass('p-5');
});
});
describe('骨架屏元素测试', () => {
it('工具骨架屏应包含动画脉冲效果', () => {
const { container } = render(<PageSkeleton />);
const skeletons = container.querySelectorAll('.animate-pulse');
expect(skeletons.length).toBeGreaterThan(0);
});
});
});