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

refactor: the List component #333

Merged
merged 6 commits into from
Aug 16, 2021
Merged

refactor: the List component #333

merged 6 commits into from
Aug 16, 2021

Conversation

wewoor
Copy link
Collaborator

@wewoor wewoor commented Aug 12, 2021

简述

List 组件完善,增加 List 单元测试

主要变更

  • 默认管理 active 状态,不用像之前需要父组件维护
  • 增加 onSelect 属性接口
  • 增加 disable 属性接口,可通过List 父组件控制 Item 是否禁用(disabled)
  • 修复 horizontal 模式样式的问题

测试

------------------|---------|----------|---------|---------|-------------------
File              | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------|---------|----------|---------|---------|-------------------         
 components/list  |     100 |    88.89 |     100 |     100 |                   
  index.tsx       |       0 |        0 |       0 |       0 |                   
  item.tsx        |     100 |      100 |     100 |     100 |                   
  list.tsx        |     100 |       80 |     100 |     100 | 70-71  

@wewoor wewoor changed the title test: the List component refactor: the List component Aug 12, 2021
@wewoor wewoor requested a review from mortalYoung August 12, 2021 12:25
@wewoor wewoor self-assigned this Aug 12, 2021
@wewoor wewoor added refactoring Refactor unit test The PR is for the unit test mainly labels Aug 12, 2021
@wewoor wewoor added this to the 0.9.0-alpha.5 milestone Aug 12, 2021
src/components/list/item.tsx Outdated Show resolved Hide resolved
src/components/list/__tests__/list.test.tsx Show resolved Hide resolved
Copy link
Collaborator

@mortalYoung mortalYoung left a comment

Choose a reason for hiding this comment

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

+1

@wewoor wewoor merged commit c6ffc92 into main Aug 16, 2021
@wewoor wewoor deleted the test/list branch August 16, 2021 08:49
@wewoor wewoor mentioned this pull request Aug 18, 2021
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor unit test The PR is for the unit test mainly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants