@@ -22,10 +22,6 @@ const CALENDAR_RANGE_CLASS = 'dx-calendar-range';
2222
2323const ARIA_LABEL_DATE_FORMAT = 'date' ;
2424
25- const toSelector = function ( className ) {
26- return '.' + className ;
27- } ;
28-
2925const getFormattedDate = ( date ) => {
3026 return dateLocalization . format ( new Date ( date ) , ARIA_LABEL_DATE_FORMAT ) ;
3127} ;
@@ -50,17 +46,17 @@ QUnit.module('Calendar markup', {
5046 } ) ;
5147
5248 QUnit . test ( 'navigator is rendered' , function ( assert ) {
53- assert . equal ( this . $element . find ( toSelector ( CALENDAR_NAVIGATOR_CLASS ) ) . length , 1 , 'navigator is rendered' ) ;
49+ assert . equal ( this . $element . find ( `. ${ CALENDAR_NAVIGATOR_CLASS } ` ) . length , 1 , 'navigator is rendered' ) ;
5450 } ) ;
5551
5652 [ 1 , 2 ] . forEach ( ( viewsCount ) => {
5753 QUnit . test ( `rendered views amount is correct when viewsCount option equals ${ viewsCount } ` , function ( assert ) {
5854 this . calendar . option ( 'viewsCount' , viewsCount ) ;
5955 if ( windowUtils . hasWindow ( ) ) {
6056 const hiddenViews = 2 ;
61- assert . equal ( this . $element . find ( toSelector ( CALENDAR_VIEWS_WRAPPER_CLASS ) + ' .dx-widget' ) . length , viewsCount + hiddenViews , 'all views are rendered' ) ;
57+ assert . equal ( this . $element . find ( `. ${ CALENDAR_VIEWS_WRAPPER_CLASS } .dx-widget` ) . length , viewsCount + hiddenViews , 'all views are rendered' ) ;
6258 } else {
63- assert . equal ( this . $element . find ( toSelector ( CALENDAR_VIEWS_WRAPPER_CLASS ) + ' .dx-widget' ) . length , viewsCount , 'only one view is rendered' ) ;
59+ assert . equal ( this . $element . find ( `. ${ CALENDAR_VIEWS_WRAPPER_CLASS } .dx-widget` ) . length , viewsCount , 'only one view is rendered' ) ;
6460 }
6561 } ) ;
6662 } ) ;
@@ -164,18 +160,18 @@ QUnit.module('Navigator', {
164160 } ) ;
165161
166162 QUnit . test ( 'Calendar must display previous and next month links, and previous and next year links' , function ( assert ) {
167- assert . strictEqual ( this . $element . find ( toSelector ( CALENDAR_NAVIGATOR_PREVIOUS_VIEW_CLASS ) ) . length , 1 ) ;
168- assert . strictEqual ( this . $element . find ( toSelector ( CALENDAR_NAVIGATOR_NEXT_VIEW_CLASS ) ) . length , 1 ) ;
163+ assert . strictEqual ( this . $element . find ( `. ${ CALENDAR_NAVIGATOR_PREVIOUS_VIEW_CLASS } ` ) . length , 1 ) ;
164+ assert . strictEqual ( this . $element . find ( `. ${ CALENDAR_NAVIGATOR_NEXT_VIEW_CLASS } ` ) . length , 1 ) ;
169165 } ) ;
170166
171167 QUnit . test ( 'Calendar must display the current month and year' , function ( assert ) {
172- const navigatorCaption = this . $element . find ( toSelector ( CALENDAR_CAPTION_BUTTON_CLASS ) ) ;
168+ const navigatorCaption = this . $element . find ( `. ${ CALENDAR_CAPTION_BUTTON_CLASS } ` ) ;
173169 assert . equal ( navigatorCaption . text ( ) , 'June 2015' ) ;
174170 } ) ;
175171
176172 QUnit . test ( 'Calendar with two views should display 2 months' , function ( assert ) {
177173 this . calendar . option ( 'viewsCount' , 2 ) ;
178- const navigatorCaption = this . $element . find ( toSelector ( CALENDAR_CAPTION_BUTTON_CLASS ) ) ;
174+ const navigatorCaption = this . $element . find ( `. ${ CALENDAR_CAPTION_BUTTON_CLASS } ` ) ;
179175 assert . equal ( navigatorCaption . text ( ) , 'June 2015July 2015' ) ;
180176 } ) ;
181177} ) ;
@@ -194,7 +190,7 @@ QUnit.module('Calendar footer', {
194190 value : new Date ( 2015 , 5 , 13 ) ,
195191 showTodayButton : true
196192 } ) . dxCalendar ( 'instance' ) ;
197- assert . equal ( $element . find ( toSelector ( CALENDAR_FOOTER_CLASS ) ) . length , 1 , 'footer exist' ) ;
193+ assert . equal ( $element . find ( `. ${ CALENDAR_FOOTER_CLASS } ` ) . length , 1 , 'footer exist' ) ;
198194 } ) ;
199195
200196 QUnit . test ( 'calendar mustn\'t have _footer if showTodayButton = false' , function ( assert ) {
@@ -203,7 +199,7 @@ QUnit.module('Calendar footer', {
203199 value : new Date ( 2015 , 5 , 13 ) ,
204200 showTodayButton : false
205201 } ) . dxCalendar ( 'instance' ) ;
206- assert . equal ( $element . find ( toSelector ( CALENDAR_FOOTER_CLASS ) ) . length , 0 , 'footer doesn\'t exist' ) ;
202+ assert . equal ( $element . find ( `. ${ CALENDAR_FOOTER_CLASS } ` ) . length , 0 , 'footer doesn\'t exist' ) ;
207203 } ) ;
208204} ) ;
209205
0 commit comments