fix: remove any types, dead code, unused exports; add comprehensive tests
- Fix handleRotate bug ignoring Result from rotateSealedSecret() - Fix dead code branch in useControllerHealth - Replace all `any` types with `unknown` + type guards - Delete unused functions/exports (452 lines removed) - Add 18 new test files covering all hooks, libs, and components - 233 tests passing, zero tsc errors, zero lint issues Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Unit tests for LoadingSkeletons components
|
||||
*/
|
||||
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
ControllerHealthSkeleton,
|
||||
SealedSecretDetailSkeleton,
|
||||
SealedSecretListSkeleton,
|
||||
SealingKeysListSkeleton,
|
||||
} from './LoadingSkeletons';
|
||||
|
||||
describe('LoadingSkeletons', () => {
|
||||
it('should render SealedSecretListSkeleton without errors', () => {
|
||||
const { container } = render(<SealedSecretListSkeleton />);
|
||||
expect(container.querySelector('.MuiSkeleton-root')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render SealedSecretDetailSkeleton without errors', () => {
|
||||
const { container } = render(<SealedSecretDetailSkeleton />);
|
||||
expect(container.querySelector('.MuiSkeleton-root')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render SealingKeysListSkeleton without errors', () => {
|
||||
const { container } = render(<SealingKeysListSkeleton />);
|
||||
expect(container.querySelector('.MuiSkeleton-root')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render ControllerHealthSkeleton without errors', () => {
|
||||
const { container } = render(<ControllerHealthSkeleton />);
|
||||
expect(container.querySelector('.MuiSkeleton-root')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render list skeleton with multiple rows', () => {
|
||||
const { container } = render(<SealedSecretListSkeleton />);
|
||||
const skeletons = container.querySelectorAll('.MuiSkeleton-root');
|
||||
expect(skeletons.length).toBe(5);
|
||||
});
|
||||
|
||||
it('should render detail skeleton with multiple sections', () => {
|
||||
const { container } = render(<SealedSecretDetailSkeleton />);
|
||||
const skeletons = container.querySelectorAll('.MuiSkeleton-root');
|
||||
expect(skeletons.length).toBeGreaterThanOrEqual(3);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user