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(datepicker): don't change month content if navigation is prevented #3173

Conversation

maxokorokov
Copy link
Member

Previous attempt in navigation cancellation changed was buggy → #3044

After cancellation year and month select boxes stayed unchanged, but the actual month content changed.

Test expectations were incomplete.

Previous attempt in navigation cancellation changed was buggy. After
cancellation year and month select boxes stayed unchanged, but the actual
month content changed. Test expectations were incomplete.

const button = fixture.nativeElement.querySelector('button#btn');
button.click();
fixture.detectChanges();

expect(getMonthSelect(fixture.nativeElement).value).toBe('8');
expect(getYearSelect(fixture.nativeElement).value).toBe('2016');
expect(getDay(fixture.nativeElement, 0).innerText).toBe('1');
Copy link
Member Author

Choose a reason for hiding this comment

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

This was failing with previous version, as the month was actually changed

@codecov-io
Copy link

Codecov Report

Merging #3173 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3173      +/-   ##
==========================================
- Coverage   92.34%   92.34%   -0.01%     
==========================================
  Files          91       91              
  Lines        3005     3004       -1     
  Branches      484      484              
==========================================
- Hits         2775     2774       -1     
  Misses        166      166              
  Partials       64       64
Flag Coverage Δ
#e2e 61.75% <0%> (-0.02%) ⬇️
#unit 89.96% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
src/datepicker/datepicker-service.ts 97.69% <ø> (-0.02%) ⬇️
src/datepicker/datepicker.ts 98.97% <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 044e746...aeaa90f. Read the comment docs.

@maxokorokov maxokorokov merged commit c41da80 into ng-bootstrap:master May 6, 2019
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.

None yet

2 participants