docs/archives/131-testing-redesign/phase4-补充计划.md
已完成 (2026-01-09):
待补充:
重要性: ⭐⭐⭐⭐⭐
测试用例:
// packages/core/tests/integration/llm-service.spec.ts
describe('LLM Service Integration', () => {
describe('Multi-provider support', () => {
test('OpenAI provider works with VCR', async () => {})
test('Gemini provider works with VCR', async () => {})
test('DeepSeek provider works with VCR', async () => {})
test('Custom provider works with VCR', async () => {})
})
describe('Streaming response', () => {
test('Stream chunks are correctly parsed', async () => {})
test('Stream errors are handled gracefully', async () => {})
test('Stream abort works correctly', async () => {})
})
describe('Error handling', () => {
test('Rate limit errors trigger retry', async () => {})
test('Network errors are surfaced to UI', async () => {})
test('Timeout errors are handled', async () => {})
})
describe('Model switching', () => {
test('Switching between models preserves state', async () => {})
test('Model parameters are correctly applied', async () => {})
})
})
预估时间: 2-3 天
重要性: ⭐⭐⭐⭐⭐
测试用例:
// packages/ui/tests/integration/basic-complete-workflow.spec.ts
describe('Basic-System Complete Workflow', () => {
test('End-to-end: optimize → test → iterate', async () => {
// 1. 输入 prompt
// 2. 点击优化,等待 LLM 响应
// 3. 验证优化结果显示
// 4. 测试原始和优化后的 prompt
// 5. 验证测试结果对比
// 6. 迭代优化
// 7. 验证迭代历史记录
})
test('State persistence after page reload', async () => {})
test('Error recovery when LLM fails', async () => {})
})
describe('Basic-User Complete Workflow', () => {
test('End-to-end: input → optimize → test with variables', async () => {})
test('Variable replacement works correctly', async () => {})
})
预估时间: 2-3 天
重要性: ⭐⭐⭐⭐
测试用例:
// packages/ui/tests/integration/session-store-switching.spec.ts
describe('Session Store Mode Switching', () => {
test('Switch from Basic to Context preserves common state', async () => {})
test('Switch to Image mode isolates image-specific state', async () => {})
test('Rapid mode switching does not cause state corruption', async () => {})
})
// packages/ui/tests/integration/session-store-persistence.spec.ts
describe('Session Store Persistence', () => {
test('State survives page reload', async () => {})
test('Migration from old storage format works', async () => {})
test('Concurrent tabs handle storage conflicts', async () => {})
})
预估时间: 1-2 天
重要性: ⭐⭐⭐⭐
测试用例:
// packages/ui/tests/integration/context-complete-workflow.spec.ts
describe('Context-System Multi-turn Conversation', () => {
test('End-to-end: add messages → optimize → test → iterate', async () => {})
test('V0 comparison works correctly', async () => {})
test('Variable merging from all messages works', async () => {})
})
describe('Context-User Variable Management', () => {
test('Custom variables CRUD operations', async () => {})
test('Missing variable detection and auto-creation', async () => {})
test('Variable preview updates in real-time', async () => {})
})
预估时间: 2-3 天
重要性: ⭐⭐⭐
测试用例:
// packages/core/tests/unit/services/image-storage.spec.ts
describe('ImageStorageService', () => {
test('Store and retrieve base64 images', async () => {})
test('Handle IndexedDB quota exceeded', async () => {})
test('Cleanup old images correctly', async () => {})
})
// packages/ui/tests/integration/image-history-favorites.spec.ts
describe('Image History & Favorites', () => {
test('History records are saved and displayed', async () => {})
test('Favorite management (add/remove/filter)', async () => {})
test('Category and tag filtering works', async () => {})
})
预估时间: 2-3 天
Week 1 (高优先级):
Week 2 (中优先级):
Week 3+ (可选):
仅补充 P0 高优先级测试:
理由:
先提交当前进度
git commit -m "test: 建立测试基础设施(VCR + 错误门禁 + 冒烟测试)"
创建 Phase 4 补充分支
git checkout -b feat/phase4-test-coverage
按优先级逐个实现测试
最小可行标准 (MVP):
理想标准 (Ideal):
最后更新: 2026-01-09 状态: 补充计划已完成,待用户确认优先级