Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TT-39 fix: code coverage
  • Loading branch information
scastillo-jp authored and Guido Quezada committed Dec 28, 2020
commit d472a6364c57d7f416e453efa5323d4add654bc6
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { months } from 'moment';
import * as moment from 'moment';
import { NEVER } from 'rxjs';

import { MonthPickerComponent } from './month-picker.component';

Expand Down Expand Up @@ -32,4 +33,16 @@ describe('MonthPickerComponent', () => {
expect(component.dateSelected.emit({ monthIndex: month, year: year }));
});

it('should add a year to current year', () => {
const year = moment().add(1, 'year').format('Y');
expect(component.selectedYearMoment.add(1, 'year').format('Y')).toEqual(year);
expect(component.updateYearText).toBeTruthy();
});

it('should subtract a year to current year', () => {
const year = moment().subtract(1, 'year').format('Y');
expect(component.selectedYearMoment.subtract(1, 'year').format('Y')).toEqual(year);
expect(component.updateYearText).toBeTruthy();
});

});