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/server/services/user/index.ts #6187

Merged

Conversation

gru-agent[bot]
Copy link
Contributor

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

Trigger Info

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

Summary

This PR enhances the UserService by integrating the AgentService to create an inbox for new users during the user creation process. Key changes include:

  • Mocking the AgentService in the test suite to simulate the createInbox method.

  • Updating the createUser method in UserService to call AgentService.createInbox after successfully creating a new user.

  • Adding assertions in the test cases to verify that AgentService is called appropriately and that the createInbox method is invoked.

  • Ensuring that AgentService is not called when a user already exists in the database.

These changes improve the functionality and test coverage of the UserService by ensuring that an inbox is created for new users as part of the user creation workflow.

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

@gru-agent gru-agent bot requested a review from arvinxx February 15, 2025 16:57
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 15, 2025
Copy link

vercel bot commented Feb 15, 2025

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

Name Status Preview Comments Updated (UTC)
lobe-chat-database 🛑 Canceled (Inspect) Feb 15, 2025 5:19pm
lobe-chat-preview 🛑 Canceled (Inspect) Feb 15, 2025 5:19pm

@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
Contributor Author

gru-agent bot commented Feb 15, 2025

✅ Rebase TestGru PR Success

Type Change
Base Sha 9795a6b...525cf07
Head Sha 01d54b9...5e78be1

@gru-agent gru-agent bot force-pushed the gru/src-server-services-user-index-ts-1739638640645 branch from 01d54b9 to 5e78be1 Compare February 15, 2025 16:59
@lobehubbot
Copy link
Member

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


🔄 Rebasing Testgru per ...

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.80%. Comparing base (525cf07) to head (5e78be1).
Report is 13 commits behind head on fix/assisant.

Additional details and impacted files
@@               Coverage Diff                @@
##           fix/assisant    #6187      +/-   ##
================================================
+ Coverage         91.77%   91.80%   +0.02%     
================================================
  Files               667      666       -1     
  Lines             61122    61100      -22     
  Branches           4253     3048    -1205     
================================================
- Hits              56096    56090       -6     
+ Misses             5026     5010      -16     
Flag Coverage Δ
app 91.80% <ø> (+0.02%) ⬆️
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.

@arvinxx arvinxx merged commit b812d1e into fix/assisant Feb 15, 2025
12 of 14 checks passed
@arvinxx arvinxx deleted the gru/src-server-services-user-index-ts-1739638640645 branch February 15, 2025 17:12
@lobehubbot
Copy link
Member

❤️ Great PR @gru-agent[bot] ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

@vercel vercel bot temporarily deployed to Preview – lobe-chat-preview February 15, 2025 17:18 Inactive
arvinxx pushed a commit that referenced this pull request Feb 15, 2025
#6187)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – lobe-chat-database February 15, 2025 17:19 Inactive
arvinxx pushed a commit that referenced this pull request Feb 15, 2025
#6187)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
gru-agent bot added a commit that referenced this pull request Feb 16, 2025
#6187)

Co-authored-by: gru-agent[bot] <185149714+gru-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants