Skip to content

Commit 363f7f0

Browse files
scastillo-jpjosepato87
authored andcommitted
TT-39 fix: code coverage
1 parent b3a9f8c commit 363f7f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/app/modules/shared/components/month-picker/month-picker.component.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { months } from 'moment';
2+
import * as moment from 'moment';
3+
import { NEVER } from 'rxjs';
34

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

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

36+
it('should add a year to current year', () => {
37+
const year = moment().add(1, 'year').format('Y');
38+
expect(component.selectedYearMoment.add(1, 'year').format('Y')).toEqual(year);
39+
expect(component.updateYearText).toBeTruthy();
40+
});
41+
42+
it('should subtract a year to current year', () => {
43+
const year = moment().subtract(1, 'year').format('Y');
44+
expect(component.selectedYearMoment.subtract(1, 'year').format('Y')).toEqual(year);
45+
expect(component.updateYearText).toBeTruthy();
46+
});
47+
3548
});

0 commit comments

Comments
 (0)