[PR #32377] test(web): increase coverage for files in folder plugin-page and model-provider-page #33705

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

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

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, 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

Validation Run

Lint

  • Command: pnpm eslint app/components/header/account-setting/model-provider-page/provider-added-card/ app/components/header/account-setting/plugin-page/
  • Result: Passed

Type Check

  • Command: pnpm type-check
  • Result: Passed

Tests

  • Command: pnpm vitest run app/components/header/account-setting/model-provider-page/provider-added-card/ app/components/header/account-setting/plugin-page/
  • Result: Passed

Coverage

  • Result: Passed (see below)

Coverage Report (14 Target Source Files)

Overall

  • Statements (weighted): 94.34% (367/389)

Per File

File Statements Branches Functions Lines
web/app/components/header/account-setting/model-provider-page/provider-added-card/add-model-button.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/provider-added-card/credential-panel.tsx 94.73% 87.87% 100.00% 94.59%
web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx 91.89% 86.36% 100.00% 91.66%
web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx 94.44% 76.19% 80.00% 100.00%
web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx 92.85% 33.33% 85.71% 91.66%
web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx 85.45% 84.28% 75.00% 89.79%
web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsx 94.56% 80.00% 95.45% 94.38%
web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx 100.00% 100.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-use-tip.tsx 100.00% 50.00% 100.00% 100.00%
web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx 98.11% 88.88% 100.00% 97.87%
web/app/components/header/account-setting/plugin-page/SerpapiPlugin.tsx 100.00% 75.00% 100.00% 100.00%
web/app/components/header/account-setting/plugin-page/index.tsx 87.50% 100.00% 75.00% 100.00%
web/app/components/header/account-setting/plugin-page/utils.ts 100.00% 100.00% 100.00% 100.00%

Fixes Issue - #32357

**Original Pull Request:** https://github.com/langgenius/dify/pull/32377 **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, 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/provider-added-card/add-model-button.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/add-model-button.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/credential-panel.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/credential-panel.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/index.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/index.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-use-tip.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-use-tip.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/plugin-page/SerpapiPlugin.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/plugin-page/SerpapiPlugin.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/plugin-page/index.spec.tsx](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/plugin-page/index.spec.tsx:0:0-0:0) - [web/app/components/header/account-setting/plugin-page/utils.spec.ts](cci:7://file:///home/akash.seth/Desktop/Office/dify/web/app/components/header/account-setting/plugin-page/utils.spec.ts:0:0-0:0) # Validation Run ### Lint - Command: `pnpm eslint app/components/header/account-setting/model-provider-page/provider-added-card/ app/components/header/account-setting/plugin-page/` - Result: ✅ Passed ### Type Check - Command: `pnpm type-check` - Result: ✅ Passed ### Tests - Command: `pnpm vitest run app/components/header/account-setting/model-provider-page/provider-added-card/ app/components/header/account-setting/plugin-page/` - Result: ✅ Passed ### Coverage - Result: ✅ Passed (see below) ## Coverage Report (14 Target Source Files) ### Overall - **Statements (weighted): 94.34%** (367/389) ### Per File | File | Statements | Branches | Functions | Lines | |---|---:|---:|---:|---:| | `web/app/components/header/account-setting/model-provider-page/provider-added-card/add-model-button.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/cooldown-timer.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/credential-panel.tsx` | 94.73% | 87.87% | 100.00% | 94.59% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx` | 91.89% | 86.36% | 100.00% | 91.66% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list-item.tsx` | 94.44% | 76.19% | 80.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx` | 92.85% | 33.33% | 85.71% | 91.66% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx` | 85.45% | 84.28% | 75.00% | 89.79% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-modal.tsx` | 94.56% | 80.00% | 95.45% | 94.38% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-selector.tsx` | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/priority-use-tip.tsx` | 100.00% | 50.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/model-provider-page/provider-added-card/quota-panel.tsx` | 98.11% | 88.88% | 100.00% | 97.87% | | `web/app/components/header/account-setting/plugin-page/SerpapiPlugin.tsx` | 100.00% | 75.00% | 100.00% | 100.00% | | `web/app/components/header/account-setting/plugin-page/index.tsx` | 87.50% | 100.00% | 75.00% | 100.00% | | `web/app/components/header/account-setting/plugin-page/utils.ts` | 100.00% | 100.00% | 100.00% | 100.00% | Fixes Issue - #32357
yindo added the pull-request label 2026-02-21 20:53:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33705