Skip to content

test: add unit tests for getTimeoutMSByModel and showPlugins#6817

Merged
Leizhenpeng merged 1 commit into
ChatGPTNextWeb:mainfrom
TIANQIAN1238:feat-test-model-helpers
Jul 6, 2026
Merged

test: add unit tests for getTimeoutMSByModel and showPlugins#6817
Leizhenpeng merged 1 commit into
ChatGPTNextWeb:mainfrom
TIANQIAN1238:feat-test-model-helpers

Conversation

@TIANQIAN1238

Copy link
Copy Markdown
Contributor

💻 变更类型 | Change Type

  • test

🔀 变更说明 | Description of Change

Adds test/model-helpers.test.ts covering two pure helpers in app/utils.ts that had no test coverage:

  • getTimeoutMSByModel — reasoning/image models (dall-e*, o1*, o3*, deepseek-r*, *-thinking) get the longer timeout; case-insensitivity is verified; regular chat models fall back to the default.
  • showPlugins — per-provider plugin visibility rules (OpenAI/Azure/Moonshot/ChatGLM always on; Anthropic except claude-2; Google except vision; others off).

No production code is modified.

📝 补充信息 | Additional Information

Passes locally with jest (7 tests). Prettier-formatted.

🤖 Generated with Claude Code

Both are pure functions that were not covered by the existing suites.
Cover the reasoning/image timeout branch (incl. case-insensitivity),
the default timeout branch, and the per-provider plugin visibility rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Leizhenpeng
Leizhenpeng merged commit b7c4606 into ChatGPTNextWeb:main Jul 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants