[PR #32281] test: tighten user-visible specs and raise coverage for key-validator… #33646

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

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

State: open
Merged: No


Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Unit Test Added Summary

Added spec files

  • web/app/components/header/account-setting/key-validator/KeyInput.spec.tsx
  • web/app/components/header/account-setting/key-validator/Operate.spec.tsx
  • web/app/components/header/account-setting/key-validator/ValidateStatus.spec.tsx
  • web/app/components/header/account-setting/key-validator/declarations.spec.ts
  • web/app/components/header/account-setting/key-validator/hooks.spec.ts
  • web/app/components/header/account-setting/key-validator/index.spec.tsx
  • web/app/components/header/account-setting/language-page/index.spec.tsx
  • web/app/components/header/account-setting/plugin-page/SerpapiPlugin.spec.tsx
  • web/app/components/header/account-setting/plugin-page/index.spec.tsx
  • web/app/components/header/account-setting/plugin-page/utils.spec.ts

Validation Run

Lint

pnpm --dir web lint <changed spec files>
  • Result: Passed

Tests

pnpm --dir web test <changed spec files>
  • Result: Passed (46/46 tests)

Coverage

pnpm --dir web test:coverage <changed spec files>
  • Result: Passed

Coverage Report (Changed Source Files)

File Statements (%) Branches (%) Functions (%) Lines (%)
web/app/components/header/account-setting/key-validator/KeyInput.tsx 100 100 100 100
web/app/components/header/account-setting/key-validator/Operate.tsx 100 95 100 100
web/app/components/header/account-setting/key-validator/ValidateStatus.tsx 100 100 100 100
web/app/components/header/account-setting/key-validator/declarations.ts 100 100 100 100
web/app/components/header/account-setting/key-validator/hooks.ts 100 100 100 100
web/app/components/header/account-setting/key-validator/index.tsx 100 100 100 100
web/app/components/header/account-setting/language-page/index.tsx 100 100 100 100
web/app/components/header/account-setting/plugin-page/SerpapiPlugin.tsx 100 100 100 100
web/app/components/header/account-setting/plugin-page/index.tsx 100 100 100 100
web/app/components/header/account-setting/plugin-page/utils.ts 100 100 100 100

Fixes issue - #32357

**Original Pull Request:** https://github.com/langgenius/dify/pull/32281 **State:** open **Merged:** No --- ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `make lint` and `make type-check` (backend) and `cd web && npx lint-staged` (frontend) to appease the lint gods ## Unit Test Added Summary ### Added spec files - `web/app/components/header/account-setting/key-validator/KeyInput.spec.tsx` - `web/app/components/header/account-setting/key-validator/Operate.spec.tsx` - `web/app/components/header/account-setting/key-validator/ValidateStatus.spec.tsx` - `web/app/components/header/account-setting/key-validator/declarations.spec.ts` - `web/app/components/header/account-setting/key-validator/hooks.spec.ts` - `web/app/components/header/account-setting/key-validator/index.spec.tsx` - `web/app/components/header/account-setting/language-page/index.spec.tsx` - `web/app/components/header/account-setting/plugin-page/SerpapiPlugin.spec.tsx` - `web/app/components/header/account-setting/plugin-page/index.spec.tsx` - `web/app/components/header/account-setting/plugin-page/utils.spec.ts` ## Validation Run ### Lint ```bash pnpm --dir web lint <changed spec files> ``` - Result: ✅ Passed ### Tests ```bash pnpm --dir web test <changed spec files> ``` - Result: ✅ Passed (`46/46` tests) ### Coverage ```bash pnpm --dir web test:coverage <changed spec files> ``` - Result: ✅ Passed ## Coverage Report (Changed Source Files) | File | Statements (%) | Branches (%) | Functions (%) | Lines (%) | |---|---:|---:|---:|---:| | `web/app/components/header/account-setting/key-validator/KeyInput.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/key-validator/Operate.tsx` | 100 | 95 | 100 | 100 | | `web/app/components/header/account-setting/key-validator/ValidateStatus.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/key-validator/declarations.ts` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/key-validator/hooks.ts` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/key-validator/index.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/language-page/index.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/plugin-page/SerpapiPlugin.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/plugin-page/index.tsx` | 100 | 100 | 100 | 100 | | `web/app/components/header/account-setting/plugin-page/utils.ts` | 100 | 100 | 100 | 100 | Fixes issue - #32357
yindo added the pull-request label 2026-02-21 20:53:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33646