feat(09-03): InspectTab UI + inspectCertAction + render tests

- Added inspectCertAction to actions.ts (JSON path for pemText, multipart path for file)
- Added CertDetails interface to actions.ts (mirrors API response shape)
- Implemented InspectTab: Analysieren button, loading state, grid-cols-2 result grid
- InspectTab handles wrong-password error (t('error.wrongPassword')) and generic error
- Added 2 new InspectTab tests: success grid (subject CN + SHA-256) and error (text-destructive)
- Fixed setup.ts: explicit expect.extend(matchers) for vitest@4.x compatibility
  (Rule 1: @testing-library/jest-dom/vitest not extending global expect in vitest 4)
- Fixed existing test: getByText -> getAllByText for 'Analysieren' (now appears in tab nav + button)
- 9/9 cert-manager tests pass
This commit is contained in:
2026-07-01 23:55:41 +02:00
parent ba994635e8
commit 64a8e725e7
4 changed files with 285 additions and 7 deletions
+11
View File
@@ -1,3 +1,14 @@
import { expect } from 'vitest';
import * as matchers from '@testing-library/jest-dom/matchers';
// Explicitly extend vitest's expect with jest-dom matchers.
// Using the explicit extend approach (not @testing-library/jest-dom/vitest) for
// compatibility with vitest@4.x (the /vitest barrel doesn't extend the same
// expect instance in vitest 4's module resolution).
expect.extend(matchers as any);
// Type augmentation for the custom matchers (adds toBeInTheDocument, etc.)
// This import only carries type declarations — no runtime effect.
import '@testing-library/jest-dom/vitest';
// Polyfill ResizeObserver for jsdom (needed by react-grid-layout)