@@ -541,7 +541,7 @@ describe('AnalyticalTable', () => {
541
541
) ;
542
542
543
543
// select all
544
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
544
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
545
545
546
546
// expand
547
547
cy . get ( '[aria-rowindex="2"] > [aria-colindex="2"] > [title="Expand Node"] > [ui5-icon]' ) . click ( ) ;
@@ -555,11 +555,15 @@ describe('AnalyticalTable', () => {
555
555
cy . get ( '[aria-rowindex="4"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
556
556
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
557
557
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
558
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
558
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
559
+ 'have.attr' ,
560
+ 'indeterminate' ,
561
+ 'true'
562
+ ) ;
559
563
560
564
// deselect all
561
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
562
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
565
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
566
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
563
567
cy . get ( '@onIndeterminateChangeSpy' ) . should ( 'have.callCount' , 2 ) ;
564
568
565
569
// select leaf row
@@ -569,11 +573,15 @@ describe('AnalyticalTable', () => {
569
573
cy . get ( '[aria-rowindex="4"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
570
574
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
571
575
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
572
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
576
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
577
+ 'have.attr' ,
578
+ 'indeterminate' ,
579
+ 'true'
580
+ ) ;
573
581
574
582
// deselect all
575
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
576
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
583
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
584
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
577
585
cy . get ( '@onIndeterminateChangeSpy' ) . should ( 'have.callCount' , 4 ) ;
578
586
579
587
// select row with subRows
@@ -587,7 +595,11 @@ describe('AnalyticalTable', () => {
587
595
cy . get ( '[aria-rowindex="8"] > [aria-colindex="1"]' ) . should ( 'have.attr' , 'aria-selected' , 'true' ) ;
588
596
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
589
597
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
590
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
598
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
599
+ 'have.attr' ,
600
+ 'indeterminate' ,
601
+ 'true'
602
+ ) ;
591
603
} ) ;
592
604
593
605
it ( 'useIndeterminateRowSelection' , ( ) => {
@@ -602,7 +614,7 @@ describe('AnalyticalTable', () => {
602
614
/>
603
615
) ;
604
616
// select all
605
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
617
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
606
618
607
619
// expand
608
620
cy . get ( '[aria-rowindex="2"] > [aria-colindex="2"] > [title="Expand Node"] > [ui5-icon]' ) . click ( ) ;
@@ -616,11 +628,15 @@ describe('AnalyticalTable', () => {
616
628
cy . get ( '[aria-rowindex="4"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
617
629
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
618
630
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
619
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
631
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
632
+ 'have.attr' ,
633
+ 'indeterminate' ,
634
+ 'true'
635
+ ) ;
620
636
621
637
// deselect all
622
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
623
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
638
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
639
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
624
640
cy . get ( '@onIndeterminateChangeSpy' ) . should ( 'have.callCount' , 2 ) ;
625
641
626
642
// select leaf row
@@ -630,11 +646,15 @@ describe('AnalyticalTable', () => {
630
646
cy . get ( '[aria-rowindex="4"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
631
647
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
632
648
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
633
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
649
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
650
+ 'have.attr' ,
651
+ 'indeterminate' ,
652
+ 'true'
653
+ ) ;
634
654
635
655
// deselect all
636
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
637
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
656
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
657
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
638
658
cy . get ( '@onIndeterminateChangeSpy' ) . should ( 'have.callCount' , 4 ) ;
639
659
640
660
// select row with subRows
@@ -648,7 +668,11 @@ describe('AnalyticalTable', () => {
648
668
cy . get ( '[aria-rowindex="8"] > [aria-colindex="1"]' ) . should ( 'have.attr' , 'aria-selected' , 'false' ) ;
649
669
cy . get ( '[aria-rowindex="3"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
650
670
cy . get ( '[aria-rowindex="2"] > [aria-colindex="1"] [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
651
- cy . get ( '#__ui5wcr__internal_selection_column [ui5-checkbox]' ) . should ( 'have.attr' , 'indeterminate' , 'true' ) ;
671
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"] [ui5-checkbox]' ) . should (
672
+ 'have.attr' ,
673
+ 'indeterminate' ,
674
+ 'true'
675
+ ) ;
652
676
} ) ;
653
677
654
678
it ( 'Grow Mode: maxWidth' , ( ) => {
@@ -681,10 +705,10 @@ describe('AnalyticalTable', () => {
681
705
) ;
682
706
} ;
683
707
cy . mount ( < TableComp data = { data } /> ) ;
684
- cy . get ( '# name' ) . invoke ( 'outerWidth' ) . should ( 'equal' , 700 ) ;
708
+ cy . get ( '[data-column-id=" name"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , 700 ) ;
685
709
686
710
cy . findByText ( 'Custom maxWidth' ) . click ( ) ;
687
- cy . get ( '# name' ) . invoke ( 'outerWidth' ) . should ( 'equal' , 5008 ) ;
711
+ cy . get ( '[data-column-id=" name"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , 5008 ) ;
688
712
} ) ;
689
713
690
714
it ( 'Column Scaling: programatically change cols' , ( ) => {
@@ -755,16 +779,16 @@ describe('AnalyticalTable', () => {
755
779
cy . mount ( < TestComp data = { data } { ...item . props } /> ) ;
756
780
757
781
cy . findByText ( 'Both' ) . click ( ) ;
758
- cy . get ( '# name' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . bothWidth ) ;
759
- cy . get ( '# age' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . bothWidth ) ;
782
+ cy . get ( '[data-column-id=" name"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . bothWidth ) ;
783
+ cy . get ( '[data-column-id=" age"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . bothWidth ) ;
760
784
761
785
cy . findByText ( 'NameCol' ) . click ( ) ;
762
- cy . get ( '# name' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . onlyNameWidth ) ;
763
- cy . get ( '# age' ) . should ( 'not.exist' , { timeout : 100 } ) ;
786
+ cy . get ( '[data-column-id=" name"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . onlyNameWidth ) ;
787
+ cy . get ( '[data-column-id=" age"] ' ) . should ( 'not.exist' , { timeout : 100 } ) ;
764
788
765
789
cy . findByText ( 'AgeCol' ) . click ( ) ;
766
- cy . get ( '# age' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . onlyAgeWidth ) ;
767
- cy . get ( '# name' ) . should ( 'not.exist' , { timeout : 100 } ) ;
790
+ cy . get ( '[data-column-id=" age"] ' ) . invoke ( 'outerWidth' ) . should ( 'equal' , item . onlyAgeWidth ) ;
791
+ cy . get ( '[data-column-id=" name"] ' ) . should ( 'not.exist' , { timeout : 100 } ) ;
768
792
} ) ;
769
793
} ) ;
770
794
@@ -803,15 +827,22 @@ describe('AnalyticalTable', () => {
803
827
cy . wait ( 200 ) ;
804
828
805
829
cy . findByText ( 'set clientWidth' ) . click ( ) ;
806
- [ '#name' , '#age' , '#friend\\.name' , '#friend\\.age' ] . forEach ( ( col ) => {
830
+ [
831
+ '[data-column-id="name"]' ,
832
+ '[data-column-id="age"]' ,
833
+ '[data-column-id="friend\\.name"]' ,
834
+ '[data-column-id="friend\\.age"]'
835
+ ] . forEach ( ( col ) => {
807
836
cy . get ( col ) . invoke ( 'outerWidth' ) . should ( 'equal' , 300 ) ;
808
837
} ) ;
809
838
810
839
cy . findByText ( 'hide age col' ) . click ( ) ;
811
- [ '#name' , '#friend\\.name' , '#friend\\.age' ] . forEach ( ( col ) => {
812
- cy . get ( col ) . invoke ( 'outerWidth' ) . should ( 'equal' , 400 ) ;
813
- } ) ;
814
- cy . get ( '#age' ) . should ( 'not.exist' , { timeout : 100 } ) ;
840
+ [ '[data-column-id="name"]' , '[data-column-id="friend\\.name"]' , '[data-column-id="friend\\.age"]' ] . forEach (
841
+ ( col ) => {
842
+ cy . get ( col ) . invoke ( 'outerWidth' ) . should ( 'equal' , 400 ) ;
843
+ }
844
+ ) ;
845
+ cy . get ( '[data-column-id="age"]' ) . should ( 'not.exist' , { timeout : 100 } ) ;
815
846
} ) ;
816
847
817
848
it ( 'InfiniteScroll' , ( ) => {
@@ -1469,7 +1500,9 @@ describe('AnalyticalTable', () => {
1469
1500
) ;
1470
1501
} ;
1471
1502
cy . mount ( < TestComponent onRowSelect = { select } onRowClick = { click } /> ) ;
1472
- cy . get ( '#__ui5wcr__internal_selection_column[role="columnheader"]' ) . find ( '[ui5-checkbox]' ) . should ( 'not.exist' ) ;
1503
+ cy . get ( '[data-column-id="__ui5wcr__internal_selection_column"][role="columnheader"]' )
1504
+ . find ( '[ui5-checkbox]' )
1505
+ . should ( 'not.exist' ) ;
1473
1506
let selectCalled = 0 ;
1474
1507
let clickCalled = 1 ;
1475
1508
// colindex 1 === selection cell
@@ -1578,7 +1611,7 @@ describe('AnalyticalTable', () => {
1578
1611
cy . mount ( < AnalyticalTable data = { dataTree } columns = { columns } isTreeTable /> ) ;
1579
1612
cy . get ( '[data-empty-row="true"]' ) . should ( 'have.length' , 3 ) ;
1580
1613
cy . mount ( < ShowSelectedComp /> ) ;
1581
- cy . get ( '# __ui5wcr__internal_selection_column' ) . click ( ) ;
1614
+ cy . get ( '[data-column-id=" __ui5wcr__internal_selection_column"] ' ) . click ( ) ;
1582
1615
cy . findByText ( 'Show Selected' ) . click ( ) ;
1583
1616
cy . findByText ( 'Selected: {"0":true,"1":true,"2":true,"3":true}' ) . should ( 'be.visible' ) ;
1584
1617
cy . get ( '[data-empty-row="true"]' ) . click ( ) ;
0 commit comments