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

add test for switch, ref #1274 #1513

Merged
merged 3 commits into from
Jun 30, 2017
Merged

add test for switch, ref #1274 #1513

merged 3 commits into from
Jun 30, 2017

Conversation

silentcloud
Copy link
Contributor

@silentcloud silentcloud commented Jun 30, 2017

This change is Reviewable

@mention-bot
Copy link

@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
Copy link

codecov bot commented Jun 30, 2017

Codecov Report

Merging #1513 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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
Flag Coverage Δ
#rn 79.81% <ø> (ø) ⬆️
#web 64.61% <ø> (ø) ⬆️
Impacted Files Coverage Δ
components/switch/index.web.tsx 65.71% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61f53b8...1d0de70. Read the comment docs.

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`
Copy link
Contributor

Choose a reason for hiding this comment

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

把相关的 issue 贴出来吧

Copy link
Contributor

Choose a reason for hiding this comment

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

你这个测试用例测错了,checkbox 的 value 本来就不变的...
应该测 checked 这个 attribute

Copy link
Contributor

Choose a reason for hiding this comment

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

至于 这个 value=on 我猜是 chrome 默认的?

Copy link
Contributor

Choose a reason for hiding this comment

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

确认,是 react 的默认值,不是 chrome 的

@paranoidjk paranoidjk merged commit 3f2fab7 into master Jun 30, 2017
@paranoidjk paranoidjk deleted the switch-test branch June 30, 2017 11:02
lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this pull request Apr 26, 2018
* add test for switch, ref ant-design#1274

* add issue url

* fix: test
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.

3 participants