[PR #27850] test: create new test scripts and update some existing test scripts o… #31873

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

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

State: closed
Merged: Yes


Description

This PR adds comprehensive test coverage for 9 frontend utility modules, creating comprehensive tests.

Fixes

Closes #26000
Closes #25974
Closes #25962

Test Files Added

  1. navigation.spec.ts - URL and query parameter manipulation
  2. completion-params.spec.ts - Model parameter validation and merging
  3. classnames.spec.ts - CSS class manipulation with Tailwind merge
  4. app-redirection.spec.ts - Permission-based routing logic
  5. time.spec.ts - Date comparison and formatting
  6. permission.spec.ts - Dataset edit permission logic
  7. mcp.spec.ts - Model Context Protocol icon detection
  8. tool-call.spec.ts - AI model function call support detection
  9. get-icon.spec.ts - Marketplace plugin icon URL generation

All tests follow best practices with proper mocking, edge case coverage, and clear documentation.

Screenshots

Before After
Not enough test coverage for core utility modules Comprehensive test coverage across 9 utility modules (navigation, completion-params, classnames, app-redirection, time, permission, mcp, tool-call, get-icon)

Checklist

  • 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 dev/reformat (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

Contribution by Gittensor, learn more at https://gittensor.io/

**Original Pull Request:** https://github.com/langgenius/dify/pull/27850 **State:** closed **Merged:** Yes --- ## Description This PR adds comprehensive test coverage for 9 frontend utility modules, creating comprehensive tests. ### Fixes Closes #26000 Closes #25974 Closes #25962 ### Test Files Added 1. **`navigation.spec.ts`** - URL and query parameter manipulation 2. **`completion-params.spec.ts`** - Model parameter validation and merging 3. **`classnames.spec.ts`** - CSS class manipulation with Tailwind merge 4. **`app-redirection.spec.ts`** - Permission-based routing logic 5. **`time.spec.ts`** - Date comparison and formatting 6. **`permission.spec.ts`** - Dataset edit permission logic 7. **`mcp.spec.ts`** - Model Context Protocol icon detection 8. **`tool-call.spec.ts`** - AI model function call support detection 9. **`get-icon.spec.ts`** - Marketplace plugin icon URL generation All tests follow best practices with proper mocking, edge case coverage, and clear documentation. ## Screenshots | Before | After | |--------|-------| | Not enough test coverage for core utility modules | Comprehensive test coverage across 9 utility modules (navigation, completion-params, classnames, app-redirection, time, permission, mcp, tool-call, get-icon) | ## Checklist - [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 `dev/reformat` (backend) and `cd web && npx lint-staged` (frontend) to appease the lint gods Contribution by Gittensor, learn more at https://gittensor.io/
yindo added the pull-request label 2026-02-21 20:50:18 -05:00
yindo closed this issue 2026-02-21 20:50:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31873