[PR #29709] test: add comprehensive tests for CustomizeModal component #32526

Closed
opened 2026-02-21 20:51:34 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: Yes


Summary

  • Add comprehensive Jest tests for app/components/app/overview/customize/ component
  • 25 test cases covering all aspects of the CustomizeModal
  • Remove unused linkUrl prop from component and its usage

Test Coverage

Metric Coverage
Statements 100%
Branches 100%
Functions 100%
Lines 100%

Test Scenarios

  • Rendering: Modal title, description, tags, step numbers, instructions, env variables
  • Props: appId and api_base_url display correctly in environment config
  • Mode-based GitHub link: All 5 AppModeEnum values tested (CHAT, ADVANCED_CHAT, COMPLETION, WORKFLOW, AGENT_CHAT)
  • External links: GitHub and Vercel links with correct security attributes
  • User Interactions: Way 2 button opens documentation, modal close button
  • Edge Cases: Empty values, special characters
  • StepNum component: Styling verification
  • GithubIcon component: SVG rendering

Test plan

  • All 25 tests pass
  • Type check passes (pnpm type-check:tsgo)
  • ESLint passes
**Original Pull Request:** https://github.com/langgenius/dify/pull/29709 **State:** closed **Merged:** Yes --- ## Summary - Add comprehensive Jest tests for `app/components/app/overview/customize/` component - 25 test cases covering all aspects of the CustomizeModal - Remove unused `linkUrl` prop from component and its usage ## Test Coverage | Metric | Coverage | |--------|----------| | Statements | 100% | | Branches | 100% | | Functions | 100% | | Lines | 100% | ## Test Scenarios - **Rendering**: Modal title, description, tags, step numbers, instructions, env variables - **Props**: appId and api_base_url display correctly in environment config - **Mode-based GitHub link**: All 5 AppModeEnum values tested (CHAT, ADVANCED_CHAT, COMPLETION, WORKFLOW, AGENT_CHAT) - **External links**: GitHub and Vercel links with correct security attributes - **User Interactions**: Way 2 button opens documentation, modal close button - **Edge Cases**: Empty values, special characters - **StepNum component**: Styling verification - **GithubIcon component**: SVG rendering ## Test plan - [x] All 25 tests pass - [x] Type check passes (`pnpm type-check:tsgo`) - [x] ESLint passes
yindo added the pull-request label 2026-02-21 20:51:34 -05:00
yindo closed this issue 2026-02-21 20:51:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32526