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:
@@ -15,7 +15,6 @@ const localStorageMock = {
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
isValidNamespace,
|
||||
validatePEMCertificate,
|
||||
validateSecretKey,
|
||||
validateSecretName,
|
||||
@@ -80,27 +79,6 @@ describe('validators', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateNamespace', () => {
|
||||
it('should accept valid namespace names', () => {
|
||||
expect(isValidNamespace('default')).toBe(true);
|
||||
expect(isValidNamespace('kube-system')).toBe(true);
|
||||
expect(isValidNamespace('my-namespace')).toBe(true);
|
||||
expect(isValidNamespace('ns-123')).toBe(true);
|
||||
});
|
||||
|
||||
it('should reject invalid namespace names', () => {
|
||||
expect(isValidNamespace('')).toBe(false);
|
||||
expect(isValidNamespace('My-Namespace')).toBe(false);
|
||||
expect(isValidNamespace('-namespace')).toBe(false);
|
||||
expect(isValidNamespace('namespace-')).toBe(false);
|
||||
expect(isValidNamespace('namespace_name')).toBe(false);
|
||||
});
|
||||
|
||||
it('should reject namespaces exceeding 253 characters', () => {
|
||||
expect(isValidNamespace('x'.repeat(254))).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateSecretKey', () => {
|
||||
it('should accept valid secret keys', () => {
|
||||
expect(validateSecretKey('password').valid).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user