@@ -1432,6 +1432,7 @@ describe('Picker.Basic', () => {
1432
1432
1433
1433
it ( 'classNames and styles should support time panel' , async ( ) => {
1434
1434
const testClassNames = {
1435
+ root : 'test-root' ,
1435
1436
input : 'test-input' ,
1436
1437
prefix : 'test-prefix' ,
1437
1438
suffix : 'test-suffix' ,
@@ -1442,6 +1443,7 @@ describe('Picker.Basic', () => {
1442
1443
} ;
1443
1444
1444
1445
const testStyles = {
1446
+ root : { color : 'red' } ,
1445
1447
input : { color : 'red' } ,
1446
1448
prefix : { color : 'green' } ,
1447
1449
suffix : { color : 'blue' } ,
@@ -1470,15 +1472,20 @@ describe('Picker.Basic', () => {
1470
1472
generateConfig = { momentGenerateConfig }
1471
1473
/> ,
1472
1474
) ;
1475
+ const root = container . querySelector ( '.rc-picker' ) ;
1473
1476
const input = container . querySelectorAll ( '.rc-picker-input input' ) [ 0 ] ;
1474
1477
const prefix = container . querySelector ( '.rc-picker-prefix' ) ;
1475
1478
const suffix = container . querySelector ( '.rc-picker-suffix' ) ;
1479
+
1480
+ expect ( root ) . toHaveClass ( testClassNames . root ) ;
1481
+ expect ( root ) . toHaveStyle ( testStyles . root ) ;
1476
1482
expect ( input ) . toHaveClass ( testClassNames . input ) ;
1477
1483
expect ( input ) . toHaveStyle ( testStyles . input ) ;
1478
1484
expect ( prefix ) . toHaveClass ( testClassNames . prefix ) ;
1479
1485
expect ( prefix ) . toHaveStyle ( testStyles . prefix ) ;
1480
1486
expect ( suffix ) . toHaveClass ( testClassNames . suffix ) ;
1481
1487
expect ( suffix ) . toHaveStyle ( testStyles . suffix ) ;
1488
+
1482
1489
const { container : panel } = render (
1483
1490
< PickerPanel
1484
1491
classNames = { testPopupClassNames }
@@ -1496,6 +1503,14 @@ describe('Picker.Basic', () => {
1496
1503
expect ( item ) . toHaveStyle ( testPopupStyles . item ) ;
1497
1504
} ) ;
1498
1505
1506
+ it ( 'rootClassName' , ( ) => {
1507
+ render ( < DayPicker rootClassName = "bamboo" open /> ) ;
1508
+
1509
+ expect ( document . body . querySelectorAll ( '.bamboo' ) ) . toHaveLength ( 2 ) ;
1510
+ expect ( document . body . querySelector ( '.rc-picker' ) ) . toHaveClass ( 'bamboo' ) ;
1511
+ expect ( document . body . querySelector ( '.rc-picker-dropdown' ) ) . toHaveClass ( 'bamboo' ) ;
1512
+ } ) ;
1513
+
1499
1514
it ( 'showTime config should have format' , ( ) => {
1500
1515
render (
1501
1516
< DayPicker
0 commit comments