'use client' import { useState } from 'react' import { PROJECT_BASE_PATH } from '../data' const testDocLinks = [ { file: 'docs/testing/README.md', label: 'Test-Uebersicht', desc: 'Teststrategie & Coverage-Ziele' }, { file: 'docs/testing/QUICKSTART.md', label: 'Quickstart', desc: 'Schnellstart fuer Tests' }, { file: 'docs/testing/INTEGRATION_TESTS.md', label: 'Integrationstests', desc: 'API & DB Tests' }, ] const coverageTargets = [ { component: 'Go Consent Service', target: '80%', current: '~75%', color: 'green' }, { component: 'Python Backend', target: '70%', current: '~65%', color: 'yellow' }, { component: 'Critical Paths (Auth, OAuth)', target: '95%', current: '~90%', color: 'green' }, ] const testCommands = [ { label: 'Go Tests (alle)', cmd: 'cd consent-service && go test -v ./...', lang: 'Go' }, { label: 'Go Tests mit Coverage', cmd: 'cd consent-service && go test -cover ./...', lang: 'Go' }, { label: 'Python Tests (alle)', cmd: 'cd backend && source venv/bin/activate && pytest -v', lang: 'Python' }, { label: 'Python Tests mit Coverage', cmd: 'cd backend && pytest --cov=. --cov-report=html', lang: 'Python' }, ] export default function TestingTab() { const [copiedEndpoint, setCopiedEndpoint] = useState(null) const copyToClipboard = (text: string, id: string) => { navigator.clipboard.writeText(text) setCopiedEndpoint(id) setTimeout(() => setCopiedEndpoint(null), 2000) } return (
{/* Quick Links to Docs */}

Test-Dokumentation

Vollstaendige Docs in VS Code
{testDocLinks.map((doc) => (
{doc.label}
{doc.desc}
))}
{/* Test Pyramid */}

Test-Pyramide

{`                /\\
               /  \\  E2E (10%)
              /----\\
             /      \\  Integration (20%)
            /--------\\
           /          \\  Unit Tests (70%)
          /--------------\\`}
{/* Coverage Ziele */}

Coverage-Ziele

{coverageTargets.map((item) => (
{item.component}
{item.current}
Ziel: {item.target}
))}
{/* Test Commands */}

Test-Befehle

{testCommands.map((item, idx) => (
{item.lang}
{item.label}
{item.cmd}
))}
{/* Test-Struktur */}

Test-Struktur

{/* Go Tests */}

Go Consent Service

consent-service/
internal/
handlers/handlers_test.go
services/auth_service_test.go
services/oauth_service_test.go
services/totp_service_test.go
middleware/middleware_test.go
{/* Python Tests */}

Python Backend

backend/
tests/
test_consent_client.py
test_gdpr_api.py
test_dsms_webui.py
conftest.py
) }