[PR #32392] test(web): increase test coverage for components inside header folder #33707

Open
opened 2026-02-21 20:53:45 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/32392

State: open
Merged: No


Checklist

  • This change requires a documentation update
  • I’ve added/updated tests for the behavior covered in this change
  • Test, lint, type check, and coverage passed for updated header specs
  • No backend/API code paths were changed

Unit Test Added Summary

Added/Updated spec files

  • web/app/components/header/ maintenance-notice.spec.tsx
  • web/app/components/header/app-back/index.spec.tsx
  • web/app/components/header/app-nav/index.spec.tsx
  • web/app/components/header/app-selector/index.spec.tsx
  • web/app/components/header/dataset-nav/index.spec.tsx
  • web/app/components/header/env-nav/index.spec.tsx
  • web/app/components/header/explore-nav/index.spec.tsx
  • web/app/components/header/header-wrapper.spec.tsx
  • web/app/components/header/index.spec.tsx
  • web/app/components/header/indicator/index.spec.tsx
  • web/app/components/header/license-env/index.spec.tsx
  • web/app/components/header/nav/index.spec.tsx
  • web/app/components/header/nav/nav-selector/index.spec.tsx
  • web/app/components/header/plan-badge/index.spec.tsx
  • web/app/components/header/plugins-nav/index.spec.tsx
  • web/app/components/header/tools-nav/index.spec.tsx

Validation Run

Lint

  • Command: pnpm -C web exec eslint <target-spec-files>
  • Result: Passed

Type Check

  • Command: pnpm -C web type-check:tsgo
  • Result: Passed

Tests

  • Command: pnpm -C web test <target-spec-files>
  • Result: Passed (16 files, 113 tests)

Coverage

  • Command: pnpm -C web exec vitest run --coverage --coverage.include=<16-target-source-files> <target-spec-files>
  • Result: Passed

Coverage Report (16 Target Source Files)

Overall stats

  • Statements: 100.00%
  • Branches: 96.61%
  • Functions: 100.00%
  • Lines: 100.00%
File Statements Branches Functions Lines
web/app/components/header/app-back/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/app-nav/index.tsx 100.00% 86.36% 100.00% 100.00%
web/app/components/header/app-selector/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/dataset-nav/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/env-nav/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/explore-nav/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/header-wrapper.tsx 100.00% 87.50% 100.00% 100.00%
web/app/components/header/index.tsx 100.00% 94.11% 100.00% 100.00%
web/app/components/header/indicator/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/license-env/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/maintenance-notice.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/nav/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/nav/nav-selector/index.tsx 100.00% 95.45% 100.00% 100.00%
web/app/components/header/plan-badge/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/plugins-nav/index.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/tools-nav/index.tsx 100.00% 100.00% 100.00% 100.00%

Fixes #32357

**Original Pull Request:** https://github.com/langgenius/dify/pull/32392 **State:** open **Merged:** No --- ## Checklist - [ ] This change requires a documentation update - [x] I’ve added/updated tests for the behavior covered in this change - [x] Test, lint, type check, and coverage passed for updated header specs - [x] No backend/API code paths were changed ## Unit Test Added Summary ### Added/Updated spec files - `web/app/components/header/ maintenance-notice.spec.tsx` - `web/app/components/header/app-back/index.spec.tsx` - `web/app/components/header/app-nav/index.spec.tsx` - `web/app/components/header/app-selector/index.spec.tsx` - `web/app/components/header/dataset-nav/index.spec.tsx` - `web/app/components/header/env-nav/index.spec.tsx` - `web/app/components/header/explore-nav/index.spec.tsx` - `web/app/components/header/header-wrapper.spec.tsx` - `web/app/components/header/index.spec.tsx` - `web/app/components/header/indicator/index.spec.tsx` - `web/app/components/header/license-env/index.spec.tsx` - `web/app/components/header/nav/index.spec.tsx` - `web/app/components/header/nav/nav-selector/index.spec.tsx` - `web/app/components/header/plan-badge/index.spec.tsx` - `web/app/components/header/plugins-nav/index.spec.tsx` - `web/app/components/header/tools-nav/index.spec.tsx` ## Validation Run ### Lint - Command: `pnpm -C web exec eslint <target-spec-files>` - Result: ✅ Passed ### Type Check - Command: `pnpm -C web type-check:tsgo` - Result: ✅ Passed ### Tests - Command: `pnpm -C web test <target-spec-files>` - Result: ✅ Passed (`16` files, `113` tests) ### Coverage - Command: `pnpm -C web exec vitest run --coverage --coverage.include=<16-target-source-files> <target-spec-files>` - Result: ✅ Passed ## Coverage Report (16 Target Source Files) ### Overall stats - Statements: **100.00%** - Branches: **96.61%** - Functions: **100.00%** - Lines: **100.00%** | File | Statements | Branches | Functions | Lines | |---|---:|---:|---:|---:| | `web/app/components/header/app-back/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/app-nav/index.tsx` | 100.00% | 86.36% | 100.00% | 100.00% | | `web/app/components/header/app-selector/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/dataset-nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/env-nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/explore-nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/header-wrapper.tsx` | 100.00% | 87.50% | 100.00% | 100.00% | | `web/app/components/header/index.tsx` | 100.00% | 94.11% | 100.00% | 100.00% | | `web/app/components/header/indicator/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/license-env/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/maintenance-notice.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/nav/nav-selector/index.tsx` | 100.00% | 95.45% | 100.00% | 100.00% | | `web/app/components/header/plan-badge/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/plugins-nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/tools-nav/index.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | Fixes #32357
yindo added the pull-request label 2026-02-21 20:53:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33707