[PR #32367] test: add unit tests for chat components #33699

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

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

State: open
Merged: No


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Test Coverage Summary

Component File Statements Branches Functions Lines
Log index 100% 100% 100% 100%
Thought index 100% 100% 100% 100%
Loading Animation index 100% 100% 100% 100%
Chat Input Area operation 100% 100% 100% 100%
index 91.3% 90% 68.75% 91.17%
Content Switch content-switch 100% 100% 100% 100%
Try to Ask try-to-ask 100% 100% 100% 100%
Answer tool-detail 100% 100% 100% 100%
human-input-filled-form-list 100% 100% 100% 100%
suggested-questions 100% 100% 100% 100%
workflow-process 100% 100% 100% 100%
human-input-form-list 100% 100% 100% 100%
basic-content 100% 90.1% 100% 100%
agent-content 100% 92.85% 100% 100%
operation 98.83% 91.09% 100% 98.8%
Citation index 100% 100% 100% 100%
popup 100% 90% 100% 100%
progress-tooltip 100% 100% 100% 100%
tooltip 100% 100% 100% 100%
Chat Context context 100% 100% 100% 100%
Chat index 96.73% 92.95% 100% 96.59%
question 97.36% 86.2% 100% 97.36%
Human Input Content content-item 100% 100% 100% 100%
content-wrapper 100% 100% 100% 100%
executed-action 100% 100% 100% 100%
expiration-time 100% 100% 100% 100%
human-input-form 100% 100% 100% 100%
submitted-content 100% 100% 100% 100%
submitted 100% 100% 100% 100%
tips 100% 100% 100% 100%
unsubmitted 100% 100% 100% 100%

Screenshots

Before After
... ...

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

Fixes #32152

**Original Pull Request:** https://github.com/langgenius/dify/pull/32367 **State:** open **Merged:** No --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Test Coverage Summary | Component | File | Statements | Branches | Functions | Lines | |---|---|---|---|---|---| | **Log** | index | 100% | 100% | 100% | 100% | | **Thought** | index | 100% | 100% | 100% | 100% | | **Loading Animation** | index | 100% | 100% | 100% | 100% | | **Chat Input Area** | operation | 100% | 100% | 100% | 100% | | | index | 91.3% | 90% | 68.75% | 91.17% | | **Content Switch** | content-switch | 100% | 100% | 100% | 100% | | **Try to Ask** | try-to-ask | 100% | 100% | 100% | 100% | | **Answer** | tool-detail | 100% | 100% | 100% | 100% | | | human-input-filled-form-list | 100% | 100% | 100% | 100% | | | suggested-questions | 100% | 100% | 100% | 100% | | | workflow-process | 100% | 100% | 100% | 100% | | | human-input-form-list | 100% | 100% | 100% | 100% | | | basic-content | 100% | 90.1% | 100% | 100% | | | agent-content | 100% | 92.85% | 100% | 100% | | | operation | 98.83% | 91.09% | 100% | 98.8% | | **Citation** | index | 100% | 100% | 100% | 100% | | | popup | 100% | 90% | 100% | 100% | | | progress-tooltip | 100% | 100% | 100% | 100% | | | tooltip | 100% | 100% | 100% | 100% | | **Chat Context** | context | 100% | 100% | 100% | 100% | | **Chat** | index | 96.73% | 92.95% | 100% | 96.59% | | | question | 97.36% | 86.2% | 100% | 97.36% | | **Human Input Content** | content-item | 100% | 100% | 100% | 100% | | | content-wrapper | 100% | 100% | 100% | 100% | | | executed-action | 100% | 100% | 100% | 100% | | | expiration-time | 100% | 100% | 100% | 100% | | | human-input-form | 100% | 100% | 100% | 100% | | | submitted-content | 100% | 100% | 100% | 100% | | | submitted | 100% | 100% | 100% | 100% | | | tips | 100% | 100% | 100% | 100% | | | unsubmitted | 100% | 100% | 100% | 100% | ## Screenshots | Before | After | |--------|-------| | ... | ... | ## 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 Fixes #32152
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#33699