test(seo): expand structured data tests to cover all 7 schema components
- Add 24 new tests for ServiceSchema, ProductSchema, FAQSchema, BreadcrumbSchema, and LocalBusinessSchema (previously uncovered) - Raise SEO component coverage from 40.89% → 100% (all metrics) - Update jest.config.js coverage thresholds to reflect Phase 7实测 values - Sync test-strategy-plan.md to v1.8 with latest coverage data - Update README.md progress with 1509 tests / 73.59% stmts / 82.38% branches
This commit is contained in:
@@ -24,6 +24,14 @@
|
||||
- 2026-07:完成 CMS 数据模型扩展(locale、RBAC)、媒体管理、工作流引擎,并按页面类型全量迁移内容(基于 [docs/cms-evaluation.md](./docs/cms-evaluation.md))
|
||||
- 2026-07:完成系统化测试套件实施(Phase 1-5 ✅)
|
||||
- 2026-07: **封版发布 v1.0.0-phase1** — UI设计重构 ~85% / CMS化 ~75% / 全量测试 992 条通过
|
||||
- 2026-08: **Phase 6 测试收尾** — ESLint 0 errors、覆盖率提升至 63.23% stmts / 78.02% branches、新增 18 个测试套件 225 条测试、全量 1217 条通过
|
||||
- 2026-08: **文档同步完成** — test-strategy-plan.md 版本 1.5,已标记已实现项,保留真实缺口
|
||||
- 2026-08: **迭代完成** — test-strategy-plan.md 版本 1.8,全面达标
|
||||
- 120 测试套件 / 1509 条测试全部通过,ESLint 0 errors
|
||||
- 覆盖率:global 73.59% stmts / 82.38% branches(全阈值达标)
|
||||
- seo/ 组件覆盖率提升至 100%(新增 24 个测试,覆盖全部 7 个组件)
|
||||
- analytics/ 7 组件全覆盖,新增至覆盖率监控
|
||||
- 测试债务追踪板同步更新,seo 覆盖缺口已解决
|
||||
|
||||
## 项目进度
|
||||
|
||||
@@ -71,8 +79,11 @@
|
||||
- [x] UI设计重构 ~85%:设计系统完整、四层叙事模型已实施、咨询专业风骨架确立
|
||||
- [x] CMS化 ~75%:所有页面已集成 CMS 数据层、种子脚本覆盖全部内容类型
|
||||
- [x] 清理旧版文件:归档 12 个旧版组件至 _archive/(home-content-v11~v13, products-content-v1, product-detail-v1~v2, solutions-content-v1, news-content-v1, team-content-v1~v2, contact-content-v1~v2)
|
||||
- [x] 质量门禁通过:type-check ✅ / lint ✅(153 预存 errors) / 992 tests ✅ / coverage 达标 ✅
|
||||
- [x] 质量门禁通过:type-check ✅ / lint ✅(0 errors) / 1217 tests ✅ / coverage 达标 ✅
|
||||
- [x] 生产环境变量与 Nginx 安全头确认完成:CSP / Permissions-Policy / HSTS 已配置,.env.production 密钥已生成
|
||||
- [x] Phase 6 测试收尾:ESLint 0 errors、新增 18 个测试套件 / 225 条测试、覆盖率 Stmts 63.23% / Branches 78.02%
|
||||
- [x] **最终验收确认 (2026-08-02)**:type-check ✅ / lint 0 errors ✅ / 单元测试 90 suites / 1217 tests ✅ / 集成测试 11 suites / 96 tests ✅ / 覆盖率阈值达标 ✅
|
||||
- [x] **文档同步 (2026-08-02)**:test-strategy-plan.md 版本 1.5,已标记已实现项,保留真实缺口
|
||||
|
||||
## 技术栈
|
||||
|
||||
@@ -193,8 +204,8 @@ novalon-website/
|
||||
| `npm run lint` | 运行 ESLint 检查 |
|
||||
| `npm run type-check` | TypeScript 类型检查 |
|
||||
| `npm run test` | 运行 E2E 测试 |
|
||||
| `npm run test:unit` | 运行单元测试(Jest,72 suites / 992 tests) |
|
||||
| `npm run test:coverage` | 运行测试覆盖率(当前 Branches 75.61%, Lines 50.82%) |
|
||||
| `npm run test:unit` | 运行单元测试(Jest,120 suites / 1509 tests) |
|
||||
| `npm run test:coverage` | 运行测试覆盖率(当前 Branches 82.38%, Lines 73.59%) |
|
||||
| `npm run test:e2e:fast` | 运行 E2E 快速测试(@smoke + @critical 标签) |
|
||||
| `npm run test:e2e:standard` | 运行 E2E 标准回归测试(@regression 标签) |
|
||||
| `npm run test:smoke` | 运行 E2E 冒烟测试(@smoke 标签) |
|
||||
@@ -242,7 +253,7 @@ novalon-website/
|
||||
|
||||
| 工具 | 用途 | 配置 |
|
||||
|------|------|------|
|
||||
| **Jest** | 单元测试(72 suites / 992 tests) | `config/test/jest.config.js` |
|
||||
| **Jest** | 单元测试(120 suites / 1509 tests) | `config/test/jest.config.js` |
|
||||
| **Playwright** | E2E / 视觉回归 / 用户旅程测试 | `e2e/playwright.config.ts` |
|
||||
| **Stryker** | 变异测试(评估测试质量) | `stryker.config.json` |
|
||||
| **Allure** | 测试报告可视化 | Allure Playwright reporter |
|
||||
@@ -265,10 +276,10 @@ novalon-website/
|
||||
|
||||
```bash
|
||||
# 单元测试
|
||||
npm run test:unit # 954 tests
|
||||
npm run test:unit # 1509 tests
|
||||
|
||||
# 测试覆盖率
|
||||
npm run test:coverage # Branches 74.77%, Lines 50.78%
|
||||
npm run test:coverage # Branches 82.38%, Lines 73.59%
|
||||
|
||||
# E2E 测试
|
||||
npm run test # 全量 E2E(631 passed)
|
||||
|
||||
Reference in New Issue
Block a user