fix(admin-v2): Restore complete admin-v2 application
The admin-v2 application was incomplete in the repository. This commit restores all missing components: - Admin pages (76 pages): dashboard, ai, compliance, dsgvo, education, infrastructure, communication, development, onboarding, rbac - SDK pages (45 pages): tom, dsfa, vvt, loeschfristen, einwilligungen, vendor-compliance, tom-generator, dsr, and more - Developer portal (25 pages): API docs, SDK guides, frameworks - All components, lib files, hooks, and types - Updated package.json with all dependencies The issue was caused by incomplete initial repository state - the full admin-v2 codebase existed in backend/admin-v2 and docs-src/admin-v2 but was never fully synced to the main admin-v2 directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
127
admin-v2/components/sdk/__tests__/StepHeader.test.tsx
Normal file
127
admin-v2/components/sdk/__tests__/StepHeader.test.tsx
Normal file
@@ -0,0 +1,127 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { STEP_EXPLANATIONS } from '../StepHeader'
|
||||
|
||||
// Focus on testing the STEP_EXPLANATIONS data structure
|
||||
// Component tests require more complex SDK context mocking
|
||||
|
||||
describe('STEP_EXPLANATIONS', () => {
|
||||
it('should have explanations for all Phase 1 steps', () => {
|
||||
const phase1Steps = [
|
||||
'use-case-workshop',
|
||||
'screening',
|
||||
'modules',
|
||||
'requirements',
|
||||
'controls',
|
||||
'evidence',
|
||||
'audit-checklist',
|
||||
'risks',
|
||||
]
|
||||
|
||||
phase1Steps.forEach(stepId => {
|
||||
expect(STEP_EXPLANATIONS[stepId]).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].title).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].title.length).toBeGreaterThan(0)
|
||||
expect(STEP_EXPLANATIONS[stepId].description).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].description.length).toBeGreaterThan(0)
|
||||
expect(STEP_EXPLANATIONS[stepId].explanation).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].explanation.length).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
|
||||
it('should have explanations for all Phase 2 steps', () => {
|
||||
const phase2Steps = [
|
||||
'ai-act',
|
||||
'obligations',
|
||||
'dsfa',
|
||||
'tom',
|
||||
'loeschfristen',
|
||||
'vvt',
|
||||
'consent',
|
||||
'cookie-banner',
|
||||
'einwilligungen',
|
||||
'dsr',
|
||||
'escalations',
|
||||
]
|
||||
|
||||
phase2Steps.forEach(stepId => {
|
||||
expect(STEP_EXPLANATIONS[stepId]).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].title).toBeDefined()
|
||||
expect(STEP_EXPLANATIONS[stepId].description).toBeDefined()
|
||||
})
|
||||
})
|
||||
|
||||
it('should have tips array for each step explanation', () => {
|
||||
Object.entries(STEP_EXPLANATIONS).forEach(([stepId, explanation]) => {
|
||||
expect(explanation.tips).toBeDefined()
|
||||
expect(Array.isArray(explanation.tips)).toBe(true)
|
||||
expect(explanation.tips.length).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
|
||||
it('should have valid tip icons', () => {
|
||||
const validIcons = ['info', 'warning', 'success', 'lightbulb']
|
||||
|
||||
Object.entries(STEP_EXPLANATIONS).forEach(([stepId, explanation]) => {
|
||||
explanation.tips.forEach((tip, tipIndex) => {
|
||||
expect(validIcons).toContain(tip.icon)
|
||||
expect(tip.title).toBeDefined()
|
||||
expect(tip.title.length).toBeGreaterThan(0)
|
||||
expect(tip.description).toBeDefined()
|
||||
expect(tip.description.length).toBeGreaterThan(0)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a use-case-workshop explanation', () => {
|
||||
const ucWorkshop = STEP_EXPLANATIONS['use-case-workshop']
|
||||
|
||||
expect(ucWorkshop.title).toContain('Use Case')
|
||||
expect(ucWorkshop.tips.length).toBeGreaterThanOrEqual(2)
|
||||
})
|
||||
|
||||
it('should have a risks explanation', () => {
|
||||
const risks = STEP_EXPLANATIONS['risks']
|
||||
|
||||
expect(risks.title).toBeDefined()
|
||||
expect(risks.explanation).toContain('Risiko')
|
||||
})
|
||||
|
||||
it('should have a dsfa explanation', () => {
|
||||
const dsfa = STEP_EXPLANATIONS['dsfa']
|
||||
|
||||
expect(dsfa.title).toContain('Datenschutz')
|
||||
expect(dsfa.explanation.length).toBeGreaterThan(50)
|
||||
})
|
||||
|
||||
it('should cover all 19 SDK steps', () => {
|
||||
const allStepIds = [
|
||||
// Phase 1
|
||||
'use-case-workshop',
|
||||
'screening',
|
||||
'modules',
|
||||
'requirements',
|
||||
'controls',
|
||||
'evidence',
|
||||
'audit-checklist',
|
||||
'risks',
|
||||
// Phase 2
|
||||
'ai-act',
|
||||
'obligations',
|
||||
'dsfa',
|
||||
'tom',
|
||||
'loeschfristen',
|
||||
'vvt',
|
||||
'consent',
|
||||
'cookie-banner',
|
||||
'einwilligungen',
|
||||
'dsr',
|
||||
'escalations',
|
||||
]
|
||||
|
||||
expect(Object.keys(STEP_EXPLANATIONS).length).toBe(allStepIds.length)
|
||||
|
||||
allStepIds.forEach(stepId => {
|
||||
expect(STEP_EXPLANATIONS[stepId]).toBeDefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user