[PR #32360] test(web): add tests for model-provider-page files in header account-… #33692

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

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

State: open
Merged: No


Checklist

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

Unit Test Added Summary

Added/Updated spec files

  • web/app/components/header/account-setting/model-provider-page/model-badge/index.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-icon/index.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-name/index.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-modal/Form.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-modal/Input.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-modal/index.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/configuration-button.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-display.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/presets-parameter.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/status-indicators.spec.tsx
  • web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.spec.tsx

Validation Run

Lint

pnpm --dir web eslint app/components/header/account-setting/model-provider-page/model-badge/index.spec.tsx app/components/header/account-setting/model-provider-page/model-icon/index.spec.tsx app/components/header/account-setting/model-provider-page/model-name/index.spec.tsx app/components/header/account-setting/model-provider-page/model-modal/*.spec.tsx app/components/header/account-setting/model-provider-page/model-parameter-modal/*.spec.tsx
  • Result: Passed

Type Check

pnpm --dir web type-check:tsgo
  • Result: Passed

Tests

pnpm --dir web test app/components/header/account-setting/model-provider-page/model-badge app/components/header/account-setting/model-provider-page/model-icon app/components/header/account-setting/model-provider-page/model-name app/components/header/account-setting/model-provider-page/model-modal app/components/header/account-setting/model-provider-page/model-parameter-modal
  • Result: Passed

Coverage

pnpm --dir web test:coverage app/components/header/account-setting/model-provider-page/model-badge app/components/header/account-setting/model-provider-page/model-icon app/components/header/account-setting/model-provider-page/model-name app/components/header/account-setting/model-provider-page/model-modal app/components/header/account-setting/model-provider-page/model-parameter-modal --reporter=dot --coverage.include='app/components/header/account-setting/model-provider-page/model-badge/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-icon/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-name/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/Form.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/Input.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-parameter-modal/*.tsx'
  • Result: Passed (56/56 tests)

Coverage Report (14 Target Source Files)

Overall (14 files):

  • Statements: 95.17%
  • Branches: 78.05%
  • Functions: 91.34%
  • Lines: 96.03%
File Status in this update Statements Branches Functions Lines
web/app/components/header/account-setting/model-provider-page/model-badge/index.tsx Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx Covered in current update 100.00% 92.85% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-name/index.tsx Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx Covered in current update 100% 68.71% 82.14% 93.10%
web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx Covered in current update 100.00% 82.35% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx Covered in current update 98.90% 77.00% 76.47% 90.10%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/configuration-button.tsx Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx Covered in current update 100.00% 83.72% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-display.tsx Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx Covered in current update 100.00% 81.73% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/presets-parameter.tsx Covered in current update 100.00% 50.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/status-indicators.tsx Covered in current update 100.00% 94.44% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.tsx Covered in current update 100.00% 60.71% 100.00% 100.00%

Issue fixes - #32357

**Original Pull Request:** https://github.com/langgenius/dify/pull/32360 **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] I ran lint, tests, type-check, and coverage for the updated model-provider-page specs - [x] No backend/API code paths were changed ## Unit Test Added Summary ### Added/Updated spec files - `web/app/components/header/account-setting/model-provider-page/model-badge/index.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-icon/index.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-name/index.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-modal/Form.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-modal/Input.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-modal/index.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/configuration-button.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-display.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/presets-parameter.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/status-indicators.spec.tsx` - `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.spec.tsx` ## Validation Run ### Lint ```bash pnpm --dir web eslint app/components/header/account-setting/model-provider-page/model-badge/index.spec.tsx app/components/header/account-setting/model-provider-page/model-icon/index.spec.tsx app/components/header/account-setting/model-provider-page/model-name/index.spec.tsx app/components/header/account-setting/model-provider-page/model-modal/*.spec.tsx app/components/header/account-setting/model-provider-page/model-parameter-modal/*.spec.tsx ``` - Result: ✅ Passed ### Type Check ```bash pnpm --dir web type-check:tsgo ``` - Result: ✅ Passed ### Tests ```bash pnpm --dir web test app/components/header/account-setting/model-provider-page/model-badge app/components/header/account-setting/model-provider-page/model-icon app/components/header/account-setting/model-provider-page/model-name app/components/header/account-setting/model-provider-page/model-modal app/components/header/account-setting/model-provider-page/model-parameter-modal ``` - Result: ✅ Passed ### Coverage ```bash pnpm --dir web test:coverage app/components/header/account-setting/model-provider-page/model-badge app/components/header/account-setting/model-provider-page/model-icon app/components/header/account-setting/model-provider-page/model-name app/components/header/account-setting/model-provider-page/model-modal app/components/header/account-setting/model-provider-page/model-parameter-modal --reporter=dot --coverage.include='app/components/header/account-setting/model-provider-page/model-badge/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-icon/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-name/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/Form.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/Input.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-modal/index.tsx' --coverage.include='app/components/header/account-setting/model-provider-page/model-parameter-modal/*.tsx' ``` - Result: ✅ Passed (56/56 tests) ## Coverage Report (14 Target Source Files) **Overall (14 files):** - **Statements:** `95.17%` - **Branches:** `78.05%` - **Functions:** `91.34%` - **Lines:** `96.03%` | File | Status in this update | Statements | Branches | Functions | Lines | |---|---|---:|---:|---:|---:| | `web/app/components/header/account-setting/model-provider-page/model-badge/index.tsx` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-icon/index.tsx` | Covered in current update | 100.00% | 92.85% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-name/index.tsx` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-modal/Form.tsx` | Covered in current update | 100% | 68.71% | 82.14% | 93.10% | | `web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx` | Covered in current update | 100.00% | 82.35% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-modal/index.tsx` | Covered in current update | 98.90% | 77.00% | 76.47% | 90.10% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/agent-model-trigger.tsx` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/configuration-button.tsx` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx` | Covered in current update | 100.00% | 83.72% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/model-display.tsx` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/parameter-item.tsx` | Covered in current update | 100.00% | 81.73% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/presets-parameter.tsx` | Covered in current update | 100.00% | 50.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/status-indicators.tsx` | Covered in current update | 100.00% | 94.44% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/model-parameter-modal/trigger.tsx` | Covered in current update | 100.00% | 60.71% | 100.00% | 100.00% | Issue fixes - #32357
yindo added the pull-request label 2026-02-21 20:53:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33692