514de78ba7
- Fix ExemptionManager apiVersion bug (apps/batch resources used wrong API path) - Replace resource: any with proper KubeResource interface (strict TypeScript) - Replace all var(--mui-palette-*) CSS variables with useTheme() + theme.palette.* - Replace custom drawer with MUI Drawer component (proper a11y and theming) - Replace alert() calls with StatusLabel-based inline feedback - Add PolarisErrorBoundary wrapping all registered plugin components - Export getPolarisApiPath/isFullUrl from polaris.ts, deduplicate in PolarisSettings - Fix PolarisDataContext test mock missing triggerRefresh - Fix DashboardView test SimpleTable mock using any - Remove dead NamespaceDetailView (replaced by drawer), unused MockPolarisProvider, unused getSeverityColor export - Add tests for InlineAuditSection, AppBarScoreBadge, topIssues, checkMapping (32 new) - Update CLAUDE.md, CHANGELOG.md, README.md for v0.6.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
650 B
TypeScript
27 lines
650 B
TypeScript
import { AuditData, Result } from './api/polaris';
|
|
|
|
// --- Fixtures ---
|
|
|
|
export function makeResult(overrides: Partial<Result> = {}): Result {
|
|
return {
|
|
Name: 'my-deploy',
|
|
Namespace: 'default',
|
|
Kind: 'Deployment',
|
|
Results: {},
|
|
CreatedTime: '2025-01-01T00:00:00Z',
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function makeAuditData(results: Result[]): AuditData {
|
|
return {
|
|
PolarisOutputVersion: '1.0',
|
|
AuditTime: '2025-01-01T00:00:00Z',
|
|
SourceType: 'Cluster',
|
|
SourceName: 'test',
|
|
DisplayName: 'test',
|
|
ClusterInfo: { Version: '1.28', Nodes: 3, Pods: 10, Namespaces: 2, Controllers: 5 },
|
|
Results: results,
|
|
};
|
|
}
|