test: refactor tests for Tag component#328
Merged
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #328 +/- ##
==========================================
+ Coverage 89.71% 89.82% +0.10%
==========================================
Files 141 141
Lines 8393 8393
Branches 3447 3447
==========================================
+ Hits 7530 7539 +9
+ Misses 835 828 -7
+ Partials 28 26 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
✨ PR Preview Link: https://preview-328-arco-design-mobile.surge.sh |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive set of tests for the Tag component and its List variant to ensure they render correctly with variations in type, size, style, and behavior.
- New tests for different tag types, sizes, colors, and icons.
- Additional tests for Tag.List including padding configurations, add area customization, and callback functions for close and add actions.
Comments suppressed due to low confidence (2)
packages/arcodesign/components/tag/test/index.spec.js:66
- Ensure that 'prefix' is defined or imported in this test file to make the test self-contained.
expect(container1.querySelector(`.${prefix}-primary`)).toBeInTheDocument();
packages/arcodesign/components/tag/test/index.spec.js:150
- Confirm that 'defaultContext' is available in the test scope or imported correctly to prevent reference errors.
const listElement1 = container1.querySelector(`.${defaultContext.prefixCls}-tag-list`);
Tag componentTag component
tangshumin666
approved these changes
Jun 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the test coverage for the
TagandTag.Listcomponents inpackages/arcodesign/components/tag/__test__/index.spec.js. It introduces new test cases to verify component behavior under various scenarios, including mounting/unmounting, event handling, style rendering, and edge cases. Additionally, it improves the organization and clarity of the test descriptions by adding comments in both English and Chinese.Enhancements to
Tagcomponent tests:type,size,filleted,halfBorder, and custom colors.closeableproperty, ensuring proper display and behavior.Addition of
Tag.Listcomponent tests:closeabletags and edge cases like empty lists.