@@ -27,10 +27,6 @@ const LIST_GROUP_HEADER_CLASS = 'dx-list-group-header';
2727const LIST_GROUP_BODY_CLASS = 'dx-list-group-body' ;
2828const LIST_ITEM_BEFORE_BAG_CLASS = 'dx-list-item-before-bag' ;
2929
30- const toSelector = cssClass => {
31- return '.' + cssClass ;
32- } ;
33-
3430QUnit . module ( 'List markup' , { } , ( ) => {
3531 QUnit . test ( 'rendering empty message for empty list' , function ( assert ) {
3632 const element = $ ( '#list' ) . dxList ( ) ;
@@ -41,7 +37,7 @@ QUnit.module('List markup', {}, () => {
4137 const element = $ ( '#list' ) . dxList ( { items : [ '0' , '1' ] } ) ;
4238 assert . ok ( element . hasClass ( LIST_CLASS ) ) ;
4339
44- const items = element . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
40+ const items = element . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
4541 assert . equal ( items . length , 2 ) ;
4642 assert . ok ( items . eq ( 0 ) . hasClass ( LIST_ITEM_CLASS ) ) ;
4743 assert . ok ( items . eq ( 1 ) . hasClass ( LIST_ITEM_CLASS ) ) ;
@@ -56,7 +52,7 @@ QUnit.module('List markup', {}, () => {
5652 }
5753 } ) ;
5854
59- const item = element . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
55+ const item = element . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
6056
6157 assert . equal ( item . eq ( 0 ) . text ( ) , '0: a' ) ;
6258 assert . equal ( item . eq ( 1 ) . text ( ) , '1: b' ) ;
@@ -70,7 +66,7 @@ QUnit.module('List markup', {}, () => {
7066 }
7167 } ) ;
7268
73- const item = element . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
69+ const item = element . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
7470
7571 assert . equal ( item . eq ( 0 ) . text ( ) , '0: a' ) ;
7672 assert . equal ( item . eq ( 1 ) . text ( ) , '1: b' ) ;
@@ -110,16 +106,16 @@ QUnit.module('List markup', {}, () => {
110106 grouped : true
111107 } ) ;
112108
113- const groups = element . find ( toSelector ( LIST_GROUP_CLASS ) ) ;
109+ const groups = element . find ( `. ${ LIST_GROUP_CLASS } ` ) ;
114110 assert . equal ( groups . length , 2 ) ;
115111
116- const groupHeaders = element . find ( toSelector ( LIST_GROUP_HEADER_CLASS ) ) ;
112+ const groupHeaders = element . find ( `. ${ LIST_GROUP_HEADER_CLASS } ` ) ;
117113 assert . equal ( groupHeaders . length , 2 ) ;
118114
119115 assert . equal ( groupHeaders . eq ( 0 ) . text ( ) , 'group1' ) ;
120116 assert . equal ( groupHeaders . eq ( 1 ) . text ( ) , 'group2' ) ;
121117
122- const items = element . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
118+ const items = element . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
123119 assert . equal ( items . length , 3 ) ;
124120 } ) ;
125121
@@ -144,7 +140,7 @@ QUnit.module('List markup', {}, () => {
144140 }
145141 } ) ;
146142
147- const groupHeaders = element . find ( toSelector ( LIST_GROUP_HEADER_CLASS ) ) ;
143+ const groupHeaders = element . find ( `. ${ LIST_GROUP_HEADER_CLASS } ` ) ;
148144 assert . equal ( groupHeaders . eq ( 0 ) . text ( ) , '0: a' ) ;
149145 assert . equal ( groupHeaders . eq ( 1 ) . text ( ) , '1: b' ) ;
150146 } ) ;
@@ -166,7 +162,7 @@ QUnit.module('List markup', {}, () => {
166162 }
167163 } ) ;
168164
169- const groupHeaders = element . find ( toSelector ( LIST_GROUP_HEADER_CLASS ) ) ;
165+ const groupHeaders = element . find ( `. ${ LIST_GROUP_HEADER_CLASS } ` ) ;
170166 assert . ok ( groupHeaders . find ( 'span' ) . length ) ;
171167 } ) ;
172168
@@ -451,14 +447,14 @@ QUnit.module('decorators markup', {}, () => {
451447 itemDeleteMode : 'static'
452448 } ) ) ;
453449
454- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
450+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
455451 const $item = $items . eq ( 0 ) ;
456452
457- const $button = $item . find ( toSelector ( STATIC_DELETE_BUTTON_CLASS ) ) ;
453+ const $button = $item . find ( `. ${ STATIC_DELETE_BUTTON_CLASS } ` ) ;
458454
459455 assert . equal ( $button . length , 1 , 'delete button was rendered' ) ;
460456 assert . ok ( $button . parent ( ) . hasClass ( STATIC_DELETE_BUTTON_CONTAINER_CLASS ) , 'delete button was rendered in correct container' ) ;
461- assert . equal ( $list . find ( toSelector ( STATIC_DELETE_BUTTON_CLASS ) ) . length , 3 , 'delete button was rendered for all items' ) ;
457+ assert . equal ( $list . find ( `. ${ STATIC_DELETE_BUTTON_CLASS } ` ) . length , 3 , 'delete button was rendered for all items' ) ;
462458 } ) ;
463459
464460 QUnit . test ( 'list item markup, toggle delete decorator' , function ( assert ) {
@@ -468,12 +464,12 @@ QUnit.module('decorators markup', {}, () => {
468464 itemDeleteMode : 'toggle'
469465 } ) ) ;
470466
471- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
467+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
472468 const $item = $items . eq ( 0 ) ;
473469
474- const $deleteToggle = $item . children ( toSelector ( LIST_ITEM_BEFORE_BAG_CLASS ) ) . children ( toSelector ( TOGGLE_DELETE_SWITCH_CLASS ) ) ;
470+ const $deleteToggle = $item . children ( `. ${ LIST_ITEM_BEFORE_BAG_CLASS } ` ) . children ( `. ${ TOGGLE_DELETE_SWITCH_CLASS } ` ) ;
475471 assert . ok ( $deleteToggle . length , 'toggle generated' ) ;
476- assert . ok ( $deleteToggle . find ( toSelector ( TOGGLE_DELETE_SWITCH_ICON_CLASS ) ) . length , 'toggle icon generated' ) ;
472+ assert . ok ( $deleteToggle . find ( `. ${ TOGGLE_DELETE_SWITCH_ICON_CLASS } ` ) . length , 'toggle icon generated' ) ;
477473 } ) ;
478474
479475 QUnit . test ( 'list item delete icon is visible when showSelectionControls=true (T966717)' , function ( assert ) {
@@ -579,10 +575,10 @@ QUnit.module('decorators markup', {}, () => {
579575 selectionMode : 'multiple'
580576 } ) ) ;
581577
582- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
578+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
583579 const $item = $items . eq ( 0 ) ;
584- const $checkboxContainer = $item . children ( toSelector ( LIST_ITEM_BEFORE_BAG_CLASS ) ) ;
585- const $checkbox = $checkboxContainer . children ( toSelector ( SELECT_CHECKBOX_CLASS ) ) ;
580+ const $checkboxContainer = $item . children ( `. ${ LIST_ITEM_BEFORE_BAG_CLASS } ` ) ;
581+ const $checkbox = $checkboxContainer . children ( `. ${ SELECT_CHECKBOX_CLASS } ` ) ;
586582
587583 assert . ok ( $checkboxContainer . hasClass ( SELECT_CHECKBOX_CONTAINER_CLASS ) , 'container has proper class' ) ;
588584 assert . ok ( $checkbox . hasClass ( 'dx-checkbox' ) , 'select generated' ) ;
@@ -595,10 +591,10 @@ QUnit.module('decorators markup', {}, () => {
595591 selectionMode : 'single'
596592 } ) ) ;
597593
598- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
594+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
599595 const $item = $items . eq ( 0 ) ;
600- const $radioButtonContainer = $item . children ( toSelector ( SELECT_RADIO_BUTTON_CONTAINER_CLASS ) ) ;
601- const $radioButton = $radioButtonContainer . children ( toSelector ( SELECT_RADIO_BUTTON_CLASS ) ) ;
596+ const $radioButtonContainer = $item . children ( `. ${ SELECT_RADIO_BUTTON_CONTAINER_CLASS } ` ) ;
597+ const $radioButton = $radioButtonContainer . children ( `. ${ SELECT_RADIO_BUTTON_CLASS } ` ) ;
602598
603599 assert . ok ( $radioButton . hasClass ( 'dx-radiobutton' ) , 'radio button generated' ) ;
604600 } ) ;
@@ -611,7 +607,7 @@ QUnit.module('decorators markup', {}, () => {
611607 selectAllText : 'Test'
612608 } ) ) ;
613609
614- const $multipleContainer = $list . find ( toSelector ( SELECT_ALL_CLASS ) ) ;
610+ const $multipleContainer = $list . find ( `. ${ SELECT_ALL_CLASS } ` ) ;
615611 assert . equal ( $multipleContainer . length , 1 , 'container for SelectAll rendered' ) ;
616612 assert . equal ( $multipleContainer . text ( ) , 'Test' , 'select all rendered' ) ;
617613 const $checkbox = $multipleContainer . find ( '.dx-checkbox' ) ;
@@ -632,8 +628,8 @@ QUnit.module('decorators markup', {}, () => {
632628 selectionMode : 'all' ,
633629 } ) ) ;
634630
635- const $selectAllCheckBox = $list . find ( toSelector ( SELECT_ALL_CHECKBOX_CLASS ) ) ;
636- const $multipleContainer = $list . find ( toSelector ( SELECT_ALL_CLASS ) ) ;
631+ const $selectAllCheckBox = $list . find ( `. ${ SELECT_ALL_CHECKBOX_CLASS } ` ) ;
632+ const $multipleContainer = $list . find ( `. ${ SELECT_ALL_CLASS } ` ) ;
637633
638634 assert . strictEqual ( $selectAllCheckBox . attr ( 'aria-label' ) , localizedSelectAllText , 'selectAll checkbox aria-label should be equal to localized text' ) ;
639635
@@ -667,10 +663,10 @@ QUnit.module('decorators markup', {}, () => {
667663 }
668664 } ) ) ;
669665
670- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
666+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
671667 const $item = $items . eq ( 0 ) ;
672- const $handleContainer = $item . children ( toSelector ( REORDER_HANDLE_CONTAINER_CLASS ) ) ;
673- const $handle = $handleContainer . children ( toSelector ( REORDER_HANDLE_CLASS ) ) ;
668+ const $handleContainer = $item . children ( `. ${ REORDER_HANDLE_CONTAINER_CLASS } ` ) ;
669+ const $handle = $handleContainer . children ( `. ${ REORDER_HANDLE_CLASS } ` ) ;
674670
675671 assert . equal ( $handleContainer . length , 1 , 'container generated' ) ;
676672 assert . equal ( $handle . length , 1 , 'handle generated' ) ;
@@ -682,7 +678,7 @@ QUnit.module('decorators markup', {}, () => {
682678 displayExpr : 'name'
683679 } ) ;
684680
685- const $items = $list . find ( toSelector ( LIST_ITEM_CLASS ) ) ;
681+ const $items = $list . find ( `. ${ LIST_ITEM_CLASS } ` ) ;
686682
687683 assert . strictEqual ( $items . text ( ) , 'Item 1' , 'displayExpr works' ) ;
688684 } ) ;
0 commit comments