Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ test: add unit test for src/store/aiInfra/slices/aiModel/selectors.ts #6108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gru-agent[bot]
Copy link
Contributor

@gru-agent gru-agent bot commented Feb 13, 2025

Trigger Info

Trigger Type Triggered By Source Pull Request Assignment
Auto Rebase arvinxx 6106 Detail

Summary

This PR introduces comprehensive unit tests for the aiModelSelectors module, ensuring robust validation of its functionality. Key highlights include:

  • Selector Tests:

    • aiProviderChatModelListIds: Verifies filtering of chat model IDs.

    • enabledAiProviderModelList and disabledAiProviderModelList: Confirms correct segregation of enabled and disabled models.

    • filteredAiProviderModelList: Validates filtering logic based on search keywords.

    • totalAiProviderModelList and isEmptyAiProviderModelList: Tests for total count and empty state of the model list.

    • hasRemoteModels: Checks for the presence of remote models.

  • Model-Specific Tests:

    • isModelEnabled and isModelLoading: Validates enabled and loading states of models.

    • getAiModelById: Ensures correct retrieval of models by ID.

    • isModelSupportToolUse, isModelSupportVision, and isModelSupportReasoning: Confirms support for specific abilities.

    • isModelHasContextWindowToken and modelContextWindowTokens: Tests for context window token availability and retrieval.

  • Mock State: A mock state is used to simulate various scenarios, ensuring the selectors handle diverse cases effectively.

These tests enhance confidence in the correctness and reliability of the aiModelSelectors module.

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

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
lobe-chat-database ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:44pm
lobe-chat-preview ⬜️ Ignored (Inspect) Visit Preview Feb 13, 2025 2:44pm

@gru-agent gru-agent bot requested a review from arvinxx February 13, 2025 11:10
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 13, 2025
@gru-agent gru-agent bot mentioned this pull request Feb 13, 2025
8 tasks
@lobehubbot
Copy link
Member

👍 @gru-agent[bot]

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.53%. Comparing base (2243bbb) to head (988ad12).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6108      +/-   ##
==========================================
+ Coverage   92.47%   92.53%   +0.06%     
==========================================
  Files         661      661              
  Lines       60008    60008              
  Branches     2823     4435    +1612     
==========================================
+ Hits        55490    55526      +36     
+ Misses       4518     4482      -36     
Flag Coverage Δ
app 92.53% <ø> (+0.06%) ⬆️
server 97.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from style/support-check-models to main February 13, 2025 14:30
Copy link
Contributor Author

gru-agent bot commented Feb 13, 2025

✅ Rebase TestGru PR Success

Type Change
Base Sha 2243bbb...2243bbb
Head Sha bf60064...988ad12

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


🔄 Rebasing Testgru per ...

@gru-agent gru-agent bot force-pushed the testgru-src-store-aiInfra-slices-aiModel-selectors.ts-1739445027829 branch from bf60064 to 988ad12 Compare February 13, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants