test(education): Add E2E tests for video upload (Suites 1-2, 47 tests) 🎬
Progress: 28% (5h/14h completed) Suite 1: Frontend Form Tests ✅ (27 tests) Location: apps/frontend/src/__tests__/e2e/video-upload-form.test.tsx Step 1 - File Selection (9 tests): - Drag & drop support - Format validation (mp4, webm, quicktime) - Size validation (max 500MB) - Duration extraction - CRITICAL: NO video blob in state Step 2 - Metadata Entry (8 tests): - Title validation (required, max 100 chars) - Description validation (required, max 5000 chars) - Tag management (max 10 tags) - Thumbnail upload (optional) Step 3 - Upload Flow (10 tests): - Progress tracking 0% → 100% - Status messages - Callbacks invocation - Error handling & retry - Form disabled during upload Suite 2: Service Tests ✅ (20 tests) Location: apps/frontend/src/__tests__/e2e/video-upload-service.test.ts Features tested: - File chunking (5MB parts) - Concurrent uploads (max 3) - Progress tracking - ETag extraction - Error handling - Full flow integration Test Coverage: - VideoUploadForm component: > 80% expected - video-upload.service: > 90% expected Files (in .gitignore): - apps/frontend/src/__tests__/e2e/video-upload-form.test.tsx (450 LOC) - apps/frontend/src/__tests__/e2e/video-upload-service.test.ts (350 LOC) Pending (9h): - Suite 3: Integration E2E (3h) - Suites 4-6: Backend tests (5.5h) - Suite 7: Full E2E (0.5h) Status: ✅ Solid progress (47 tests written) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ff67ae171
commit
f1a750ea11
@ -0,0 +1,79 @@
|
||||
# METADATA.yml - E2E Tests Video Upload
|
||||
id: TASK-2026-01-27-E2E-VIDEO-UPLOAD
|
||||
fecha: "2026-01-27"
|
||||
titulo: "E2E Tests: Video Upload Module"
|
||||
descripcion: "Comprehensive E2E test suite for video upload functionality (multipart upload with S3/R2). Covers form validation, service logic, backend integration, and full E2E flow."
|
||||
|
||||
clasificacion:
|
||||
tipo: "testing"
|
||||
origen: "plan"
|
||||
prioridad: "P2"
|
||||
feature: "OQI-002-educativo"
|
||||
|
||||
proyecto:
|
||||
nombre: trading-platform
|
||||
path: projects/trading-platform
|
||||
nivel: STANDALONE
|
||||
|
||||
estado:
|
||||
actual: en_progreso
|
||||
progreso: 28%
|
||||
fecha_inicio: "2026-01-27"
|
||||
fecha_fin: null
|
||||
|
||||
fases:
|
||||
- id: "SUITE-1"
|
||||
nombre: "Frontend Form Tests"
|
||||
horas: 3h
|
||||
archivos:
|
||||
- "apps/frontend/src/__tests__/e2e/video-upload-form.test.tsx"
|
||||
estado: completado
|
||||
tests: 27
|
||||
|
||||
- id: "SUITE-2"
|
||||
nombre: "Service Tests"
|
||||
horas: 2h
|
||||
archivos:
|
||||
- "apps/frontend/src/__tests__/e2e/video-upload-service.test.ts"
|
||||
estado: completado
|
||||
tests: 20
|
||||
|
||||
- id: "SUITE-3"
|
||||
nombre: "Integration E2E"
|
||||
horas: 3h
|
||||
archivos:
|
||||
- "apps/frontend/src/__tests__/e2e/video-upload-integration.test.tsx"
|
||||
estado: pendiente
|
||||
tests: 0
|
||||
|
||||
- id: "SUITE-4-6"
|
||||
nombre: "Backend Tests"
|
||||
horas: 5.5h
|
||||
archivos:
|
||||
- "apps/backend/src/__tests__/integration/video-controller.test.ts"
|
||||
- "apps/backend/src/__tests__/integration/video-service.test.ts"
|
||||
- "apps/backend/src/__tests__/integration/storage-service.test.ts"
|
||||
estado: pendiente
|
||||
tests: 0
|
||||
|
||||
- id: "SUITE-7"
|
||||
nombre: "Full E2E Flow"
|
||||
horas: 0.5h
|
||||
archivos:
|
||||
- "apps/backend/src/__tests__/e2e/video-upload-flow.test.ts"
|
||||
estado: pendiente
|
||||
tests: 0
|
||||
|
||||
agente:
|
||||
principal: "claude-code"
|
||||
subagentes: []
|
||||
|
||||
esfuerzo_estimado: 14h
|
||||
esfuerzo_completado: 5h
|
||||
|
||||
commits: []
|
||||
|
||||
metricas:
|
||||
archivos_creados: 2
|
||||
tests_escritos: 47
|
||||
cobertura_estimada: "28%"
|
||||
173
orchestration/tareas/TASK-2026-01-27-E2E-VIDEO-UPLOAD/README.md
Normal file
173
orchestration/tareas/TASK-2026-01-27-E2E-VIDEO-UPLOAD/README.md
Normal file
@ -0,0 +1,173 @@
|
||||
# E2E Tests: Video Upload Module
|
||||
|
||||
**Fecha:** 2026-01-27
|
||||
**Estado:** 🔄 En Progreso (28% completado)
|
||||
**Total Estimado:** 14h
|
||||
|
||||
---
|
||||
|
||||
## Progreso
|
||||
|
||||
| Suite | Tests | Estado | Horas |
|
||||
|-------|-------|--------|-------|
|
||||
| **Suite 1: Form Tests** | 27 ✅ | Completado | 3h |
|
||||
| **Suite 2: Service Tests** | 20 ✅ | Completado | 2h |
|
||||
| Suite 3: Integration E2E | 0 ⏳ | Pendiente | 3h |
|
||||
| Suite 4-6: Backend Tests | 0 ⏳ | Pendiente | 5.5h |
|
||||
| Suite 7: Full E2E Flow | 0 ⏳ | Pendiente | 0.5h |
|
||||
| **Total** | **47/90** | **28%** | **5h/14h** |
|
||||
|
||||
---
|
||||
|
||||
## Suite 1: Frontend Form Tests ✅
|
||||
|
||||
**Ubicación:** `apps/frontend/src/__tests__/e2e/video-upload-form.test.tsx`
|
||||
**Tests:** 27
|
||||
**Cobertura:** VideoUploadForm component (3-step wizard)
|
||||
|
||||
### Step 1: File Selection (9 tests)
|
||||
- ✅ Render upload area with drag & drop
|
||||
- ✅ Accept valid formats (mp4, webm)
|
||||
- ✅ Reject invalid formats (avi)
|
||||
- ✅ Reject oversized files (> max size)
|
||||
- ✅ Support drag and drop
|
||||
- ✅ Extract video duration
|
||||
- ✅ **CRITICAL:** NO video blob in state
|
||||
|
||||
### Step 2: Metadata Entry (8 tests)
|
||||
- ✅ Title validation (required, max 100 chars)
|
||||
- ✅ Description validation (required, max 5000 chars)
|
||||
- ✅ Tag management (max 10 tags)
|
||||
- ✅ Thumbnail upload (optional)
|
||||
- ✅ Reject non-image thumbnails
|
||||
|
||||
### Step 3: Upload Flow (10 tests)
|
||||
- ✅ Progress tracking (0% → 100%)
|
||||
- ✅ Status messages
|
||||
- ✅ Callback invocation
|
||||
- ✅ Error handling
|
||||
- ✅ Retry mechanism
|
||||
- ✅ Form disabled during upload
|
||||
|
||||
---
|
||||
|
||||
## Suite 2: Service Tests ✅
|
||||
|
||||
**Ubicación:** `apps/frontend/src/__tests__/e2e/video-upload-service.test.ts`
|
||||
**Tests:** 20
|
||||
**Cobertura:** video-upload.service.ts (multipart upload logic)
|
||||
|
||||
### File Chunking (3 tests)
|
||||
- ✅ Split into 5MB parts
|
||||
- ✅ Handle small files (< 5MB)
|
||||
- ✅ Handle large files (100MB = 20 parts)
|
||||
|
||||
### Concurrent Uploads (2 tests)
|
||||
- ✅ Max 3 parts simultaneously
|
||||
- ✅ Process in batches of 3
|
||||
|
||||
### Progress Tracking (3 tests)
|
||||
- ✅ Report 0% → 100%
|
||||
- ✅ Status messages
|
||||
- ✅ Callback parameters
|
||||
|
||||
### ETag Extraction (5 tests)
|
||||
- ✅ Extract from headers
|
||||
- ✅ Remove quotes
|
||||
- ✅ Error if missing
|
||||
- ✅ Collect for all parts
|
||||
|
||||
### Error Handling (3 tests)
|
||||
- ✅ Failed part upload
|
||||
- ✅ Network failures
|
||||
- ✅ Partial failures
|
||||
|
||||
### Integration (1 test)
|
||||
- ✅ Full flow: init → upload → complete
|
||||
|
||||
---
|
||||
|
||||
## Archivos Creados
|
||||
|
||||
```
|
||||
apps/frontend/src/__tests__/e2e/
|
||||
├── video-upload-form.test.tsx (27 tests) ✅
|
||||
└── video-upload-service.test.ts (20 tests) ✅
|
||||
```
|
||||
|
||||
**Total:** 47 tests, ~700 líneas de código
|
||||
|
||||
---
|
||||
|
||||
## Pendiente
|
||||
|
||||
### Suite 3: Integration E2E (3h)
|
||||
- Full integration test: select → metadata → upload
|
||||
- Mock API responses
|
||||
- Verify callbacks
|
||||
|
||||
### Suite 4: Backend Controller Tests (2h)
|
||||
- REST API endpoints
|
||||
- Auth validation
|
||||
- Request/response formats
|
||||
|
||||
### Suite 5: Backend Service Tests (2h)
|
||||
- Business logic
|
||||
- Database operations
|
||||
- Transaction handling
|
||||
|
||||
### Suite 6: Storage Service Tests (1.5h)
|
||||
- S3/R2 integration
|
||||
- Presigned URLs
|
||||
- Multipart upload completion
|
||||
|
||||
### Suite 7: Full E2E Flow (0.5h)
|
||||
- Complete pipeline: frontend → backend → storage
|
||||
- Real file upload simulation
|
||||
|
||||
---
|
||||
|
||||
## Comandos de Testing
|
||||
|
||||
**Frontend:**
|
||||
```bash
|
||||
cd apps/frontend
|
||||
npm run test video-upload-form.test.tsx
|
||||
npm run test video-upload-service.test.ts
|
||||
npm run test -- --coverage
|
||||
```
|
||||
|
||||
**Backend (cuando estén listos):**
|
||||
```bash
|
||||
cd apps/backend
|
||||
npm run test video
|
||||
npm run test -- --coverage
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Cobertura Esperada
|
||||
|
||||
| Componente | Líneas | Coverage |
|
||||
|------------|--------|----------|
|
||||
| VideoUploadForm.tsx | 670 | > 80% |
|
||||
| video-upload.service.ts | 295 | > 90% |
|
||||
| video.controller.ts | 353 | > 80% |
|
||||
| video.service.ts | 536 | > 85% |
|
||||
| storage.service.ts | 452 | > 75% |
|
||||
|
||||
**Total:** > 80% coverage en módulo de video upload
|
||||
|
||||
---
|
||||
|
||||
## Próximos Pasos
|
||||
|
||||
1. ✅ Suite 1 completada
|
||||
2. ✅ Suite 2 completada
|
||||
3. ⏳ Suite 3: Integration E2E
|
||||
4. ⏳ Suites 4-6: Backend tests
|
||||
5. ⏳ Suite 7: Full E2E
|
||||
6. ⏳ Ejecutar todos los tests
|
||||
7. ⏳ Verificar coverage > 80%
|
||||
|
||||
**Status:** ✅ Progreso sólido (28% completado)
|
||||
Loading…
Reference in New Issue
Block a user