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

fix(module:cascader): should not change on hover work #1991

Merged
merged 3 commits into from
Aug 19, 2018

Conversation

shuizhongxiong
Copy link
Contributor

@shuizhongxiong shuizhongxiong commented Aug 15, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #1966

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

After fixing this issue, you should run npm run test to make sure you didn't break anything. Behavior has hanged in the test case named should change on hover work.

@shuizhongxiong
Copy link
Contributor Author

Sorry, this is my fault, I will test it again.

@shuizhongxiong
Copy link
Contributor Author

I checked it and found that there are some problems with this test case.

testComponent.nzChangeOnSelect = true; 
testComponent.nzExpandTrigger = 'hover';
...
dispatchMouseEvent(itemEl1, 'mouseenter');
...
// In this situation, testComponent values can be undefined.
expect(testComponent.values).toBeDefined();
expect(testComponent.values.length).toBe(1);
expect(testComponent.values[ 0 ]).toBe('zhejiang');

So, Can I modify it?

@wzhudev
Copy link
Member

wzhudev commented Aug 19, 2018

@shuizhongxiong Sure, go ahead.

@codecov
Copy link

codecov bot commented Aug 19, 2018

Codecov Report

Merging #1991 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1991   +/-   ##
=======================================
  Coverage   96.03%   96.03%           
=======================================
  Files         470      470           
  Lines       11417    11417           
  Branches     1513     1513           
=======================================
  Hits        10964    10964           
  Misses        130      130           
  Partials      323      323
Impacted Files Coverage Δ
components/cascader/nz-cascader.component.ts 96.55% <100%> (ø) ⬆️

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 02a84a9...08a2ca9. Read the comment docs.

@shuizhongxiong
Copy link
Contributor Author

shuizhongxiong commented Aug 19, 2018

I modified the test case and then ran the ‘npm run test’ command. Except for the ‘nz-autocomplete’ component, all other test cases passed. But I am sure that I have not touched this component, what should I do?

@wzhudev
Copy link
Member

wzhudev commented Aug 19, 2018

@shuizhongxiong You can just ignore that error. But you shouldn't have removed the test case entirely... You should modify it to make sure it's behavior is what you have changed to.

You can change test.ts to test cascader component only, and revert test.ts when you are going to commit.

If you are not familiar with Angular's test you should probably read the doc. Just take your time.

@shuizhongxiong
Copy link
Contributor Author

Thank you for your suggestion. I read some documentation about Angular's test and then fixed it again. Please take some time to check it out. If there is any problem, I will change it again.

Copy link
Member

@wzhudev wzhudev left a comment

Choose a reason for hiding this comment

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

Thanks for your excellent work!

@wzhudev
Copy link
Member

wzhudev commented Aug 19, 2018

@hsuanxyz Please review this. I think we can merge it.

@wzhudev wzhudev requested a review from hsuanxyz August 19, 2018 08:19
Copy link
Member

@hsuanxyz hsuanxyz left a comment

Choose a reason for hiding this comment

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

Hi thanks for your pr, please make sure your pr meet our guidelines.
https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit

Your commit title is too long, please reduce it. and should prefix with module

@shuizhongxiong shuizhongxiong changed the title fix(cascader):when trigger is hover and nzChangeOnSelect is turned on… fix(module:cascader): should not change on hover work Aug 19, 2018
@shuizhongxiong
Copy link
Contributor Author

@hsuanxyz Can this title be ok?

@wzhudev
Copy link
Member

wzhudev commented Aug 19, 2018

You can use git rebase to update your initial commit message to meet our guideline and push -f.

@shuizhongxiong
Copy link
Contributor Author

Is this ok?

@hsuanxyz hsuanxyz merged commit 577ae47 into NG-ZORRO:master Aug 19, 2018
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
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