@@ -8,8 +8,9 @@ import KeyCode from '@rc-component/util/lib/KeyCode';
8
8
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook' ;
9
9
import { resetWarned } from '@rc-component/util/lib/warning' ;
10
10
import React from 'react' ;
11
- import type { PickerRef } from '../src' ;
11
+ import { PickerPanel , type PickerRef } from '../src' ;
12
12
import type { PanelMode , PickerMode } from '../src/interface' ;
13
+ import momentGenerateConfig from '../src/generate/moment' ;
13
14
import enUS from '../src/locale/en_US' ;
14
15
import zhCN from '../src/locale/zh_CN' ;
15
16
import {
@@ -1371,7 +1372,30 @@ describe('Picker.Basic', () => {
1371
1372
expect ( body ) . toHaveClass ( customClassNames . popupBody ) ;
1372
1373
expect ( body ) . toHaveStyle ( customStyles . popupBody ) ;
1373
1374
} ) ;
1374
-
1375
+ it ( 'support classNames and styles for panel' , ( ) => {
1376
+ const customClassNames = {
1377
+ popupBody : 'custom-body' ,
1378
+ popupContent : 'custom-content' ,
1379
+ } ;
1380
+ const customStyles = {
1381
+ popupBody : { color : 'green' } ,
1382
+ popupContent : { color : 'blue' } ,
1383
+ } ;
1384
+ render (
1385
+ < PickerPanel
1386
+ classNames = { customClassNames }
1387
+ styles = { customStyles }
1388
+ locale = { enUS }
1389
+ generateConfig = { momentGenerateConfig }
1390
+ /> ,
1391
+ ) ;
1392
+ const content = document . querySelector ( '.rc-picker-content' ) ;
1393
+ const body = document . querySelector ( '.rc-picker-body' ) ;
1394
+ expect ( content ) . toHaveClass ( customClassNames . popupContent ) ;
1395
+ expect ( content ) . toHaveStyle ( customStyles . popupContent ) ;
1396
+ expect ( body ) . toHaveClass ( customClassNames . popupBody ) ;
1397
+ expect ( body ) . toHaveStyle ( customStyles . popupBody ) ;
1398
+ } ) ;
1375
1399
it ( 'showTime config should have format' , ( ) => {
1376
1400
render (
1377
1401
< DayPicker
0 commit comments