[PR #32436] test(base): added test coverage to form components #33742

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

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

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, and coverage for the updated specs
  • No backend/API code paths were changed

Unit Test Added Summary

Added/Updated spec files

  • web/app/components/base/form/components/label.spec.tsx (updated)
  • web/app/components/base/form/components/base/base-field.spec.tsx (new)
  • web/app/components/base/form/components/base/base-form.spec.tsx (new)
  • web/app/components/base/form/components/base/index.spec.tsx (new)
  • web/app/components/base/form/components/form/actions.spec.tsx (new)
  • web/app/components/base/form/components/field/checkbox.spec.tsx (new)
  • web/app/components/base/form/components/field/custom-select.spec.tsx (new)
  • web/app/components/base/form/components/field/file-types.spec.tsx (new)
  • web/app/components/base/form/components/field/file-uploader.spec.tsx (new)
  • web/app/components/base/form/components/field/number-input.spec.tsx (new)
  • web/app/components/base/form/components/field/number-slider.spec.tsx (new)
  • web/app/components/base/form/components/field/options.spec.tsx (new)
  • web/app/components/base/form/components/field/select.spec.tsx (new)
  • web/app/components/base/form/components/field/text.spec.tsx (new)
  • web/app/components/base/form/components/field/text-area.spec.tsx (new)
  • web/app/components/base/form/components/field/upload-method.spec.tsx (new)
  • web/app/components/base/form/components/field/variable-or-constant-input.spec.tsx (new)
  • web/app/components/base/form/components/field/variable-selector.spec.tsx (new)
  • web/app/components/base/form/components/field/input-type-select/hooks.spec.tsx (new)
  • web/app/components/base/form/components/field/input-type-select/index.spec.tsx (new)
  • web/app/components/base/form/components/field/input-type-select/option.spec.tsx (new)
  • web/app/components/base/form/components/field/input-type-select/trigger.spec.tsx (new)
  • web/app/components/base/form/components/field/input-type-select/types.spec.ts (new)
  • web/app/components/base/form/components/field/mixed-variable-text-input/index.spec.tsx (new)
  • web/app/components/base/form/components/field/mixed-variable-text-input/placeholder.spec.tsx (new)

Validation Run

Lint

pnpm --dir web eslint app/components/base/form/components/base/base-field.spec.tsx app/components/base/form/components/base/base-form.spec.tsx
  • Result: Passed

Type Check

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

Tests

pnpm --dir web test app/components/base/form/components
  • Result: Passed (76/76 tests)

Coverage

pnpm --dir web test:coverage app/components/base/form/components
  • Result: Passed

Coverage Report (Base Form Components)

File Status in this update Statements Branches Functions Lines
web/app/components/base/form/components/field/* Covered in current update 100.00% 100.00% 100.00% 100.00%
web/app/components/base/form/components/base/base-field.tsx Improved in current update 96.49% 90.41% 100.00% 96.49%
web/app/components/base/form/components/base/base-form.tsx Improved in current update 98.33% 85.71% 100.00% 98.33%
web/app/components/base/form/components/base/index.tsx Export-only module N/A N/A N/A N/A

Fixes #32152

**Original Pull Request:** https://github.com/langgenius/dify/pull/32436 **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, and coverage for the updated specs - [x] No backend/API code paths were changed ## Unit Test Added Summary ### Added/Updated spec files - `web/app/components/base/form/components/label.spec.tsx` (updated) - `web/app/components/base/form/components/base/base-field.spec.tsx` (new) - `web/app/components/base/form/components/base/base-form.spec.tsx` (new) - `web/app/components/base/form/components/base/index.spec.tsx` (new) - `web/app/components/base/form/components/form/actions.spec.tsx` (new) - `web/app/components/base/form/components/field/checkbox.spec.tsx` (new) - `web/app/components/base/form/components/field/custom-select.spec.tsx` (new) - `web/app/components/base/form/components/field/file-types.spec.tsx` (new) - `web/app/components/base/form/components/field/file-uploader.spec.tsx` (new) - `web/app/components/base/form/components/field/number-input.spec.tsx` (new) - `web/app/components/base/form/components/field/number-slider.spec.tsx` (new) - `web/app/components/base/form/components/field/options.spec.tsx` (new) - `web/app/components/base/form/components/field/select.spec.tsx` (new) - `web/app/components/base/form/components/field/text.spec.tsx` (new) - `web/app/components/base/form/components/field/text-area.spec.tsx` (new) - `web/app/components/base/form/components/field/upload-method.spec.tsx` (new) - `web/app/components/base/form/components/field/variable-or-constant-input.spec.tsx` (new) - `web/app/components/base/form/components/field/variable-selector.spec.tsx` (new) - `web/app/components/base/form/components/field/input-type-select/hooks.spec.tsx` (new) - `web/app/components/base/form/components/field/input-type-select/index.spec.tsx` (new) - `web/app/components/base/form/components/field/input-type-select/option.spec.tsx` (new) - `web/app/components/base/form/components/field/input-type-select/trigger.spec.tsx` (new) - `web/app/components/base/form/components/field/input-type-select/types.spec.ts` (new) - `web/app/components/base/form/components/field/mixed-variable-text-input/index.spec.tsx` (new) - `web/app/components/base/form/components/field/mixed-variable-text-input/placeholder.spec.tsx` (new) ### Validation Run #### Lint ```bash pnpm --dir web eslint app/components/base/form/components/base/base-field.spec.tsx app/components/base/form/components/base/base-form.spec.tsx ``` - Result: ✅ Passed #### Type Check ```bash pnpm --dir web type-check:tsgo ``` - Result: ✅ Passed #### Tests ```bash pnpm --dir web test app/components/base/form/components ``` - Result: ✅ Passed (76/76 tests) #### Coverage ```bash pnpm --dir web test:coverage app/components/base/form/components ``` - Result: ✅ Passed ## Coverage Report (Base Form Components) | File | Status in this update | Statements | Branches | Functions | Lines | |---|---|---:|---:|---:|---:| | `web/app/components/base/form/components/field/*` | Covered in current update | 100.00% | 100.00% | 100.00% | 100.00% | | `web/app/components/base/form/components/base/base-field.tsx` | Improved in current update | 96.49% | 90.41% | 100.00% | 96.49% | | `web/app/components/base/form/components/base/base-form.tsx` | Improved in current update | 98.33% | 85.71% | 100.00% | 98.33% | | `web/app/components/base/form/components/base/index.tsx` | Export-only module | N/A | N/A | N/A | N/A | Fixes #32152
yindo added the pull-request label 2026-02-21 20:53:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33742