Skip to content

Commit 120d559

Browse files
committed
test(calendar): extracted helper methods and new describe added #6453
1 parent c6bc806 commit 120d559

File tree

2 files changed

+1486
-1531
lines changed

2 files changed

+1486
-1531
lines changed

projects/igniteui-angular/src/lib/calendar/calendar-helper-utils.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { By } from '@angular/platform-browser';
33
export class HelperTestFunctions {
44
public static DAYS_VIEW = 'igx-days-view';
55
public static CALENDAR = 'igx-calendar';
6+
public static SELECTED_DATE = 'igx-calendar__date--selected';
67
public static ICON_CSSCLASS = '.igx-icon';
78
public static OVERLAY_CSSCLASS = '.igx-overlay';
89
public static MODAL_OVERLAY_CSSCLASS = 'igx-overlay__wrapper--modal';
@@ -142,4 +143,20 @@ export class HelperTestFunctions {
142143
public static getPreviousArrowElement(fixture) {
143144
return fixture.debugElement.query(By.css(HelperTestFunctions.CALENDAR_PREV_BUTTON_CSSCLASS)).nativeElement;
144145
}
146+
147+
public static verifyDateSelected(el) {
148+
expect(
149+
el.nativeElement.classList.contains(
150+
HelperTestFunctions.SELECTED_DATE
151+
)
152+
).toBe(true);
153+
}
154+
155+
public static verifyDateNotSelected(el) {
156+
expect(
157+
el.nativeElement.classList.contains(
158+
HelperTestFunctions.SELECTED_DATE
159+
)
160+
).toBe(false);
161+
}
145162
}

0 commit comments

Comments
 (0)