@@ -3550,10 +3550,36 @@ describe('TableView', function () {
3550
3550
let rows = tree . getAllByRole ( 'row' ) ;
3551
3551
3552
3552
for ( let row of rows ) {
3553
- expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '55px' ) ;
3554
- expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '315px' ) ;
3555
- expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '315px' ) ;
3556
- expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '315px' ) ;
3553
+ expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '38px' ) ;
3554
+ expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '320.6666666666667px' ) ;
3555
+ expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '320.6666666666667px' ) ;
3556
+ expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '320.6666666666667px' ) ;
3557
+ }
3558
+ } ) ;
3559
+
3560
+ it ( 'should divide the available width by default in large scale' , function ( ) {
3561
+ let tree = render ( (
3562
+ < TableView aria-label = "Table" selectionMode = "multiple" >
3563
+ < TableHeader columns = { columns } >
3564
+ { column => < Column > { column . name } </ Column > }
3565
+ </ TableHeader >
3566
+ < TableBody items = { items } >
3567
+ { item =>
3568
+ ( < Row key = { item . foo } >
3569
+ { key => < Cell > { item [ key ] } </ Cell > }
3570
+ </ Row > )
3571
+ }
3572
+ </ TableBody >
3573
+ </ TableView >
3574
+ ) , 'large' ) ;
3575
+
3576
+ let rows = tree . getAllByRole ( 'row' ) ;
3577
+
3578
+ for ( let row of rows ) {
3579
+ expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '48px' ) ;
3580
+ expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '317.3333333333333px' ) ;
3581
+ expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '317.3333333333333px' ) ;
3582
+ expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '317.3333333333333px' ) ;
3557
3583
}
3558
3584
} ) ;
3559
3585
@@ -3605,10 +3631,10 @@ describe('TableView', function () {
3605
3631
let rows = tree . getAllByRole ( 'row' ) ;
3606
3632
3607
3633
for ( let row of rows ) {
3608
- expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '55px ' ) ;
3634
+ expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '38px ' ) ;
3609
3635
expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '200px' ) ;
3610
- expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '372.5px ' ) ;
3611
- expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '372.5px ' ) ;
3636
+ expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '381px ' ) ;
3637
+ expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '381px ' ) ;
3612
3638
}
3613
3639
} ) ;
3614
3640
@@ -3660,10 +3686,10 @@ describe('TableView', function () {
3660
3686
let rows = tree . getAllByRole ( 'row' ) ;
3661
3687
3662
3688
for ( let row of rows ) {
3663
- expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '55px ' ) ;
3689
+ expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '38px ' ) ;
3664
3690
expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '200px' ) ;
3665
3691
expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '500px' ) ;
3666
- expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '245px ' ) ;
3692
+ expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '262px ' ) ;
3667
3693
}
3668
3694
} ) ;
3669
3695
@@ -3713,21 +3739,21 @@ describe('TableView', function () {
3713
3739
3714
3740
let rows = tree . getAllByRole ( 'row' ) ;
3715
3741
3716
- expect ( rows [ 0 ] . childNodes [ 0 ] . style . width ) . toBe ( '244px ' ) ;
3717
- expect ( rows [ 0 ] . childNodes [ 1 ] . style . width ) . toBe ( '756px ' ) ;
3742
+ expect ( rows [ 0 ] . childNodes [ 0 ] . style . width ) . toBe ( '230.4px ' ) ;
3743
+ expect ( rows [ 0 ] . childNodes [ 1 ] . style . width ) . toBe ( '769.6px ' ) ;
3718
3744
3719
- expect ( rows [ 1 ] . childNodes [ 0 ] . style . width ) . toBe ( '244px ' ) ;
3720
- expect ( rows [ 1 ] . childNodes [ 1 ] . style . width ) . toBe ( '378px ' ) ;
3721
- expect ( rows [ 1 ] . childNodes [ 2 ] . style . width ) . toBe ( '189px ' ) ;
3722
- expect ( rows [ 1 ] . childNodes [ 3 ] . style . width ) . toBe ( '189px ' ) ;
3745
+ expect ( rows [ 1 ] . childNodes [ 0 ] . style . width ) . toBe ( '230.4px ' ) ;
3746
+ expect ( rows [ 1 ] . childNodes [ 1 ] . style . width ) . toBe ( '384.8px ' ) ;
3747
+ expect ( rows [ 1 ] . childNodes [ 2 ] . style . width ) . toBe ( '192.4px ' ) ;
3748
+ expect ( rows [ 1 ] . childNodes [ 3 ] . style . width ) . toBe ( '192.4px ' ) ;
3723
3749
3724
3750
for ( let row of rows . slice ( 2 ) ) {
3725
- expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '55px ' ) ;
3726
- expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '189px ' ) ;
3727
- expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '189px ' ) ;
3728
- expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '189px ' ) ;
3729
- expect ( row . childNodes [ 4 ] . style . width ) . toBe ( '189px ' ) ;
3730
- expect ( row . childNodes [ 5 ] . style . width ) . toBe ( '189px ' ) ;
3751
+ expect ( row . childNodes [ 0 ] . style . width ) . toBe ( '38px ' ) ;
3752
+ expect ( row . childNodes [ 1 ] . style . width ) . toBe ( '192.4px ' ) ;
3753
+ expect ( row . childNodes [ 2 ] . style . width ) . toBe ( '192.4px ' ) ;
3754
+ expect ( row . childNodes [ 3 ] . style . width ) . toBe ( '192.4px ' ) ;
3755
+ expect ( row . childNodes [ 4 ] . style . width ) . toBe ( '192.4px ' ) ;
3756
+ expect ( row . childNodes [ 5 ] . style . width ) . toBe ( '192.4px ' ) ;
3731
3757
}
3732
3758
} ) ;
3733
3759
} ) ;
0 commit comments