Skip to content

fix: correct TextArea import in tests#164

Merged
zombieJ merged 11 commits intoreact-component:masterfrom
QDyanbing:fix/test
Mar 20, 2026
Merged

fix: correct TextArea import in tests#164
zombieJ merged 11 commits intoreact-component:masterfrom
QDyanbing:fix/test

Conversation

@QDyanbing
Copy link
Contributor

@QDyanbing QDyanbing commented Mar 20, 2026

Summary by CodeRabbit

发布说明

  • Tests
    • 优化了文本域组件的测试导入方式,改为直接命名导出方式引入 TextArea,简化测试代码结构。
  • Documentation
    • 更新示例文档中的导入方式,示例代码直接使用 TextArea 的命名导入,示例行为保持不变。

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a minor refactoring effort within the test suite. It standardizes the way the TextArea component is imported in several test files, transitioning from a pattern of importing a parent Input module and then destructuring TextArea from it, to a more direct named import of TextArea. This change enhances code readability and maintains consistency across the test codebase.

Highlights

  • Import Refactoring: Refactored the import statements for the TextArea component across multiple test files to use named imports directly.
  • Code Clarity: Improved the clarity and consistency of component imports within the test suite by removing an intermediate variable assignment.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Walkthrough

将若干测试和示例文件中的 TextArea 导入方式由通过默认 Input 对象取 Input.TextArea 改为直接使用命名导出 import { TextArea } ...,删除了中间别名声明,运行逻辑与导出签名未改变。

Changes

Cohort / File(s) Summary
TextArea 测试导入重构
tests/TextArea.allowClear.test.tsx, tests/TextArea.count.test.tsx, tests/TextArea.focus.test.tsx, tests/TextArea.showCount.test.tsx, tests/TextArea.test.tsx
TextArea 从通过默认 Input 取用改为直接命名导出(import { TextArea } from '../src'),移除 const TextArea = Input.TextArea 别名。
Docs 示例导入调整
docs/examples/textarea-allow-clear.tsx, docs/examples/textarea-auto-size.tsx, docs/examples/textarea-basic.tsx, docs/examples/textarea-show-count.tsx
示例中改为从 @rc-component/input 直接按命名导出引入 TextArea,删除中间别名行,示例行为不变。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 分钟

Possibly related PRs

Suggested reviewers

  • zombieJ
  • afc163

🐰 轻跃过旧巷口,
拿着命名的信笺跑,
TextArea 归位显身手,
别名卸下轻松笑,
测试与示例都欢跃。

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题准确反映了主要改动:更正测试文件中TextArea的导入方式,从Input.TextArea改为直接导入TextArea命名导出。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly refactors the import of the TextArea component in several test files to use a direct named import. I've suggested a couple of minor improvements to consolidate imports from the same module into a single statement for better readability.

QDyanbing and others added 3 commits March 20, 2026 23:56
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@QDyanbing QDyanbing changed the title Fix/test fix: correct TextArea import in tests Mar 20, 2026
@zombieJ zombieJ merged commit 6420856 into react-component:master Mar 20, 2026
5 checks passed
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.34%. Comparing base (c1e9676) to head (c089678).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
+ Coverage   97.57%   98.34%   +0.77%     
==========================================
  Files           4       11       +7     
  Lines         206      424     +218     
  Branches       80      136      +56     
==========================================
+ Hits          201      417     +216     
- Misses          5        7       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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