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(rating): fixed model change by clicking on disabled rating element #3574

Merged

Conversation

Smoggy
Copy link
Contributor

@Smoggy Smoggy commented Feb 3, 2020

Before submitting a pull request, please make sure you have at least performed the following:

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated any applicable tests.
  • added/updated any applicable API documentation.
  • added/updated any applicable demos.

Fixes #3465

@codecov-io
Copy link

codecov-io commented Feb 3, 2020

Codecov Report

Merging #3574 into master will increase coverage by 0.59%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3574      +/-   ##
==========================================
+ Coverage   91.12%   91.71%   +0.59%     
==========================================
  Files          95      100       +5     
  Lines        2793     2897     +104     
  Branches      516      535      +19     
==========================================
+ Hits         2545     2657     +112     
+ Misses        190      183       -7     
+ Partials       58       57       -1
Flag Coverage Δ
#e2e 56.57% <0%> (+0.75%) ⬆️
#unit 88.49% <100%> (+0.5%) ⬆️
Impacted Files Coverage Δ
src/rating/rating.ts 100% <100%> (ø) ⬆️
src/tooltip/tooltip.ts 98.43% <0%> (-0.03%) ⬇️
src/index.ts 100% <0%> (ø) ⬆️
src/tabset/tabset.module.ts 100% <0%> (ø) ⬆️
src/pagination/pagination.ts 100% <0%> (ø) ⬆️
src/progressbar/progressbar-config.ts 100% <0%> (ø) ⬆️
src/popover/popover.ts 100% <0%> (ø) ⬆️
src/modal/modal-backdrop.ts 100% <0%> (ø) ⬆️
src/accordion/accordion.ts 98.43% <0%> (ø) ⬆️
src/tabset/tabset.ts 100% <0%> (ø) ⬆️
... and 20 more

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 f4d3848...0a808fb. Read the comment docs.

@peterblazejewicz
Copy link
Contributor

@Smoggy
Is that to cover #3465? Thanks!

@Smoggy
Copy link
Contributor Author

Smoggy commented Feb 5, 2020

@peterblazejewicz Hello, yes

@maxokorokov maxokorokov added this to the 5.2.2 milestone Feb 7, 2020
Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

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

Hey, @Smoggy,

thanks for the PR. While playing with the code from the stackblitz from the issue seems to fix the problem, tests are not working:

  • the one you've added passes even without the fix
  • second change in handleKeyDown is not covered

Cheers,
Max

src/rating/rating.spec.ts Outdated Show resolved Hide resolved

handleKeyDown(event: KeyboardEvent) {
if (this.readonly || this.disabled) {
Copy link
Member

Choose a reason for hiding this comment

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

This check is not covered by tests:

Screen Shot 2020-02-07 at 11 17 17

Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

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

Hey, @Smoggy, thanks for fixing this.

LGTM, but could you please fix the test, as reporting is broken. You should always wrap async tests with async()

Will merge after you fix this.

src/rating/rating.spec.ts Outdated Show resolved Hide resolved
src/rating/rating.spec.ts Outdated Show resolved Hide resolved
@Smoggy Smoggy force-pushed the rating_template_driven_disabled_Fix branch from 6508c16 to 0a808fb Compare February 12, 2020 13:13
Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@maxokorokov maxokorokov merged commit 900a8db into ng-bootstrap:master Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NgbRating - disabled state is broken in Template-driven forms
5 participants