8000 ✅ test: add unit test for src/Markdown/demos/streaming.tsx by gru-agent[bot] · Pull Request #350 · lobehub/lobe-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

✅ test: add unit test for src/Markdown/demos/streaming.tsx #350

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

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

Conversation

gru-agent[bot]
Copy link
Contributor
@gru-agent gru-agent bot commented May 15, 2025

Trigger Info

Trigger Type Triggered By Source File Assignment
Push canisminor1990 src/Markdown/demos/streaming.tsx Detail

Summary

This PR introduces unit tests for the Markdown Streaming Demo to ensure its functionality and reliability. Key changes include:

  1. New Test File: Added tests/streaming.test.ts to validate the streaming behavior of the Markdown demo.

  2. Streaming Tests:

    • Verified initial state of streaming (content, isStreaming, isPaused).

    • Simulated streaming by incrementally updating content.

    • Tested pause and resume functionality to ensure content remains unchanged during pause and updates correctly upon resume.

    • Checked restart functionality to reset streaming state.

    • Ensured streaming completes correctly when the full content is provided.

  3. Export Enhancements: Updated streaming.tsx to export rehypePlugins and components for potential reuse or testing purposes.

These changes improve test coverage and ensure the streaming demo behaves as expected under various scenarios.

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 unknown
functions unknown
statements unknown
branches unknown
source program

Test Statuses

Status Change
passed 0 -> 2 🔺
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

Copy link
vercel bot commented May 15, 2025

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

Name Status Preview Updated (UTC)
lobe-ui ✅ Ready (Inspect) Visit Preview May 15, 2025 10:50am

@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
pkg-pr-new bot commented May 15, 2025

Open in StackBlitz

npm i https://pkg.pr.new/lobehub/lobe-ui/@lobehub/ui@350

commit: 43521cf

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
0