Skip to content

Conversation

@gru-agent
Copy link
Contributor

@gru-agent gru-agent bot commented Aug 15, 2025

Trigger Info

Trigger Type Triggered By Source Pull Request Assignment
PR Created c121914yu 5465 Detail

Summary

This PR introduces unit tests for utility functions in the utils.ts file within the web/core/app module. The tests cover the following functionalities:

  1. form2AppWorkflow Function:

    • Validates the generation of workflows based on the provided form data.

    • Tests include scenarios with no datasets or tools selected and scenarios with datasets selected.

    • Ensures the correct number of nodes and edges are generated in the workflow.

  2. filterSensitiveFormData Function:

    • Tests the filtering of sensitive data from app forms.

    • Compares the filtered form data against default form values to ensure sensitive fields are reset appropriately.

  3. getAppQGuideCustomURL Function:

    • Verifies the extraction of custom URLs from app details.

    • Includes tests for cases where a custom URL is present and cases where no URL is found, ensuring the function returns an empty string in the latter scenario.

These tests improve the reliability and maintainability of the utility functions by ensuring their behavior aligns with expected outcomes.

Coverage

The change in coverage value, such as: 0% -> 50%, indicates that the coverage was 0% before writing the tests and 50% after writing them.

https://web.dev/articles/ta-code-coverage

Type Change
lines 0% -> 68.06% 🔺
functions 100% -> 90% 🔻
statements 0% -> 68.06% 🔺
branches 100% -> 94.44% 🔻
source program

Test Statuses

Status Change
passed 0 -> 5 🔺
failed 0 -> 0
skipped 0 -> 0
source program

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

Tip

You can @gru-agent rebase to rebase the PR.

Tip

You can @gru-agent redo to reset or rebase before redoing the PR.

Tip

To modify the test code yourself, click here Edit Test Code

@github-actions
Copy link

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_9eea3282e3657924cbf71c7b5245bbc33ad6357c

@github-actions
Copy link

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_9eea3282e3657924cbf71c7b5245bbc33ad6357c

@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 23.22% 13420 / 57778
🔵 Statements 23.22% 13420 / 57778
🔵 Functions 32.02% 382 / 1193
🔵 Branches 69.39% 1043 / 1503
File CoverageNo changed files found.
Generated in workflow #1847 for commit 9eea328 by the Vitest Coverage Report Action

@github-actions
Copy link

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_9eea3282e3657924cbf71c7b5245bbc33ad6357c

@c121914yu c121914yu merged commit 14b4c08 into main Aug 20, 2025
8 checks passed
fishwww-ww pushed a commit to fishwww-ww/FastGPT that referenced this pull request Aug 21, 2025
…ring#5466)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
@c121914yu c121914yu deleted the gru/projects-app-src-web-core-app-utils-ts-1755241706915 branch October 26, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants