Skip to content

Commit 3c09e3a

Browse files
author
Guido Quezada
committed
TT-39 fix: testing selectDate()
1 parent 42aea4b commit 3c09e3a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe('MonthPickerComponent', () => {
3333
expect(component.dateSelected.emit({ monthIndex: month, year: year }));
3434
});
3535

36+
3637
it('should add a year to current year', () => {
3738
component.selectedYearMoment = moment();
3839
const incrementYear = moment().add(1, 'year').format('Y');
@@ -57,4 +58,13 @@ describe('MonthPickerComponent', () => {
5758
expect(component.selectedYearMoment.format('Y')).toEqual(decrementYear);
5859
});
5960

61+
62+
it('selectMonth should call selectDates', () => {
63+
spyOn(component, 'selectDate');
64+
65+
component.selectMonth(8);
66+
67+
expect(component.selectDate).toHaveBeenCalledWith(8, 2020);
68+
});
69+
6070
});

0 commit comments

Comments
 (0)