{ "phase": { "id": "phase-5", "name": "测试与验证", "description": "创建翻译完整性测试、插值格式测试、组件 i18n 集成测试,运行全量构建和测试验证", "dependencies": ["phase-3", "phase-4"], "tasks": [ { "id": "5.1", "name": "创建翻译完整性测试", "status": "pending", "description": "校验所有 9 种语言的翻译键与 zh-CN 完全一致(嵌套 key 逐层比对)", "files": { "create": ["src/locales/__tests__/completeness.test.ts"] }, "steps": [ { "id": "5.1.1", "action": "write_test", "description": "编写翻译完整性测试:导入所有 9 种语言翻译,递归比对键结构,报告缺失/多余键" }, { "id": "5.1.2", "action": "run_test_verify_pass", "description": "运行测试验证通过", "runCommand": "cd everything-is-suitable-uniapp && npx vitest run src/locales/__tests__/completeness.test.ts", "expectedResult": "PASS — 所有语言键结构一致" }, { "id": "5.1.3", "action": "commit", "message": "test(i18n): 添加翻译完整性校验测试" } ] }, { "id": "5.2", "name": "创建插值格式测试", "status": "pending", "description": "校验所有语言的插值变量名一致(如 {count} 在所有语言中均存在)", "files": { "create": ["src/locales/__tests__/interpolation.test.ts"] }, "steps": [ { "id": "5.2.1", "action": "write_test", "description": "编写插值格式测试:提取所有 {variable} 占位符,比对各语言一致性" }, { "id": "5.2.2", "action": "run_test_verify_pass", "description": "运行测试验证通过", "runCommand": "cd everything-is-suitable-uniapp && npx vitest run src/locales/__tests__/interpolation.test.ts", "expectedResult": "PASS — 所有语言插值变量一致" }, { "id": "5.2.3", "action": "commit", "message": "test(i18n): 添加插值格式校验测试" } ] }, { "id": "5.3", "name": "创建组件 i18n 集成测试", "status": "pending", "description": "在 vitest 配置中添加 vue-i18n 插件,为 BottomNavigation 编写 i18n 测试", "files": { "modify": ["src/components/BottomNavigation/__tests__/BottomNavigation.test.ts"] }, "steps": [ { "id": "5.3.1", "action": "write_implementation", "description": "在 vitest 配置中添加 vue-i18n 插件,确保 @vue/test-utils 的 mount 能正确注入 i18n" }, { "id": "5.3.2", "action": "write_test", "description": "为 BottomNavigation 编写 i18n 测试:验证渲染文本来自翻译键" }, { "id": "5.3.3", "action": "run_test_verify_pass", "description": "运行测试验证通过", "runCommand": "cd everything-is-suitable-uniapp && npx vitest run src/components/BottomNavigation/__tests__/", "expectedResult": "PASS" }, { "id": "5.3.4", "action": "commit", "message": "test(i18n): 添加 BottomNavigation i18n 集成测试" } ] }, { "id": "5.4", "name": "全量构建验证", "status": "pending", "description": "运行 vite build 确认构建成功", "files": {}, "steps": [ { "id": "5.4.1", "action": "verify", "description": "运行 vite build", "runCommand": "cd everything-is-suitable-uniapp && npx vite build 2>&1 | tail -10", "expectedResult": "构建成功,无错误" } ] }, { "id": "5.5", "name": "运行全量测试", "status": "pending", "description": "运行所有测试确认无回归", "files": {}, "steps": [ { "id": "5.5.1", "action": "verify", "description": "运行所有测试", "runCommand": "cd everything-is-suitable-uniapp && npx vitest run", "expectedResult": "所有测试通过" } ] }, { "id": "5.6", "name": "最终 Commit", "status": "pending", "description": "提交所有剩余变更", "files": {}, "steps": [ { "id": "5.6.1", "action": "commit", "message": "feat(i18n): 完成 UniApp 国际化改造 — 9 种语言支持" } ] } ] } }