ebaa7f3c50
ci/woodpecker/manual/woodpecker Pipeline was successful
- 移除未使用的YAML锚点定义 - 替换commands字段中的锚点引用为实际值 - 移除有问题的通知步骤 - 修复测试文件中的问题 - 添加新的测试用例和配置文件
29 lines
793 B
TypeScript
29 lines
793 B
TypeScript
import { renderHook } from '@testing-library/react';
|
|
import { ThemeProvider, useTheme } from './theme-context';
|
|
|
|
describe('theme-context', () => {
|
|
beforeEach(() => {
|
|
localStorage.clear();
|
|
});
|
|
|
|
it('应该提供默认主题', () => {
|
|
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
<ThemeProvider>{children}</ThemeProvider>
|
|
);
|
|
|
|
const { result } = renderHook(() => useTheme(), { wrapper });
|
|
|
|
expect(result.current.theme).toBe('light');
|
|
});
|
|
|
|
it('应该提供resolvedTheme', () => {
|
|
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
<ThemeProvider>{children}</ThemeProvider>
|
|
);
|
|
|
|
const { result } = renderHook(() => useTheme(), { wrapper });
|
|
|
|
expect(result.current.resolvedTheme).toBe('light');
|
|
});
|
|
});
|