@@ -11,69 +11,69 @@ describe('dpDayPicker dayPicker', () => {
11
11
page . navigateTo ( ) ;
12
12
} ) ;
13
13
14
- it ( 'should check if go to current location btn is working as expected' , ( ) => {
14
+ it ( 'should check if go to current location btn is working as expected' , async ( ) => {
15
15
const currentMonth = moment ( ) . format ( 'MMM, YYYY' ) ;
16
16
const currentYear = moment ( ) . format ( 'YYYY' ) ;
17
17
const prevMonth = moment ( ) . subtract ( 1 , 'month' ) . format ( 'MMM, YYYY' ) ;
18
18
const prevYear = moment ( ) . subtract ( 1 , 'year' ) . format ( 'YYYY' ) ;
19
19
20
- const commonDayCalendar = ( menu : ElementFinder , input : ElementFinder ) => {
21
- menu . click ( ) ;
22
- page . showGoToCurrentRadio . click ( ) ;
23
- input . click ( ) ;
24
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( true ) ;
25
- expect ( page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
26
- page . dayCalendarLeftNavBtn . click ( ) ;
27
- expect ( page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( prevMonth ) ;
28
- page . currentLocationBtn . click ( ) ;
29
- expect ( page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
30
- page . dayCalendarNavHeaderBtn . click ( ) ;
31
- expect ( page . dayCalendarNavMonthHeaderBtn . getText ( ) ) . toEqual ( currentYear ) ;
32
- page . monthCalendarLeftNavBtn . click ( ) ;
33
- expect ( page . dayCalendarNavMonthHeaderBtn . getText ( ) ) . toEqual ( prevYear ) ;
34
- page . dayCalendarNavMonthHeaderBtn . click ( ) ;
20
+ const commonDayCalendar = async ( menu : ElementFinder , input : ElementFinder ) => {
21
+ await menu . click ( ) ;
22
+ await page . showGoToCurrentRadio . click ( ) ;
23
+ await input . click ( ) ;
24
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( true ) ;
25
+ expect ( await page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
26
+ await page . dayCalendarLeftNavBtn . click ( ) ;
27
+ expect ( await page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( prevMonth ) ;
28
+ await page . currentLocationBtn . click ( ) ;
29
+ expect ( await page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
30
+ await page . dayCalendarNavHeaderBtn . click ( ) ;
31
+ expect ( await page . dayCalendarNavMonthHeaderBtn . getText ( ) ) . toEqual ( currentYear ) ;
32
+ await page . monthCalendarLeftNavBtn . click ( ) ;
33
+ expect ( await page . dayCalendarNavMonthHeaderBtn . getText ( ) ) . toEqual ( prevYear ) ;
34
+ await page . dayCalendarNavMonthHeaderBtn . click ( ) ;
35
35
36
- page . currentLocationBtn . click ( ) ;
37
- expect ( page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
36
+ await page . currentLocationBtn . click ( ) ;
37
+ expect ( await page . dayCalendarNavHeaderBtn . getText ( ) ) . toEqual ( currentMonth ) ;
38
38
39
- page . hideGoToCurrentRadio . click ( ) ;
40
- input . click ( ) ;
41
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
42
- page . dayCalendarNavHeaderBtn . click ( ) ;
43
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
39
+ await page . hideGoToCurrentRadio . click ( ) ;
40
+ await input . click ( ) ;
41
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
42
+ await page . dayCalendarNavHeaderBtn . click ( ) ;
43
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
44
44
} ;
45
45
46
- const commonMonth = ( menu : ElementFinder , input ?: ElementFinder ) => {
47
- menu . click ( ) ;
48
- page . showGoToCurrentRadio . click ( ) ;
49
- input . click ( ) ;
50
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( true ) ;
51
- expect ( page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( currentYear ) ;
52
- page . monthCalendarLeftNavBtn . click ( ) ;
53
- expect ( page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( prevYear ) ;
54
- page . currentLocationBtn . click ( ) ;
55
- expect ( page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( currentYear ) ;
46
+ const commonMonth = async ( menu : ElementFinder , input ?: ElementFinder ) => {
47
+ await menu . click ( ) ;
48
+ await page . showGoToCurrentRadio . click ( ) ;
49
+ await input . click ( ) ;
50
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( true ) ;
51
+ expect ( await page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( currentYear ) ;
52
+ await page . monthCalendarLeftNavBtn . click ( ) ;
53
+ expect ( await page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( prevYear ) ;
54
+ await page . currentLocationBtn . click ( ) ;
55
+ expect ( await page . deyCalendarMonthNavHeader . getText ( ) ) . toEqual ( currentYear ) ;
56
56
57
- page . hideGoToCurrentRadio . click ( ) ;
58
- input . click ( ) ;
59
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
57
+ await page . hideGoToCurrentRadio . click ( ) ;
58
+ await input . click ( ) ;
59
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
60
60
} ;
61
61
62
- commonDayCalendar ( page . daytimePickerMenu , page . daytimePickerInput ) ;
63
- commonDayCalendar ( page . daytimeDirectiveMenu , page . daytimeDirectiveInput ) ;
62
+ await commonDayCalendar ( page . daytimePickerMenu , page . daytimePickerInput ) ;
63
+ await commonDayCalendar ( page . daytimeDirectiveMenu , page . daytimeDirectiveInput ) ;
64
64
65
- commonDayCalendar ( page . dayPickerMenu , page . dayPickerInput ) ;
66
- commonDayCalendar ( page . dayDirectiveMenu , page . dayDirectiveInput ) ;
67
- commonDayCalendar ( page . dayDirectiveReactiveMenu , page . dayDirectiveReactiveInput ) ;
65
+ await commonDayCalendar ( page . dayPickerMenu , page . dayPickerInput ) ;
66
+ await commonDayCalendar ( page . dayDirectiveMenu , page . dayDirectiveInput ) ;
67
+ await commonDayCalendar ( page . dayDirectiveReactiveMenu , page . dayDirectiveReactiveInput ) ;
68
68
69
- commonMonth ( page . monthPickerMenu , page . monthPickerInput ) ;
70
- commonMonth ( page . monthDirectiveMenu , page . monthDirectiveInput ) ;
69
+ await commonMonth ( page . monthPickerMenu , page . monthPickerInput ) ;
70
+ await commonMonth ( page . monthDirectiveMenu , page . monthDirectiveInput ) ;
71
71
} ) ;
72
72
73
- it ( 'should hide current date button when not between min and max' , ( ) => {
74
- page . dayPickerMenu . click ( ) ;
75
- page . minSelectableInput . sendKeys ( moment ( ) . add ( 3 , 'month' ) . format ( 'DD-MM-YYYY' ) ) ;
76
- page . dayPickerInput . click ( ) ;
77
- expect ( page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
73
+ it ( 'should hide current date button when not between min and max' , async ( ) => {
74
+ await page . dayPickerMenu . click ( ) ;
75
+ await page . minSelectableInput . sendKeys ( moment ( ) . add ( 3 , 'month' ) . format ( 'DD-MM-YYYY' ) ) ;
76
+ await page . dayPickerInput . click ( ) ;
77
+ expect ( await page . currentLocationBtn . isPresent ( ) ) . toBe ( false ) ;
78
78
} ) ;
79
79
} ) ;
0 commit comments