@@ -209,6 +209,69 @@ describe('Table', () => {
209209 } ) ;
210210 } ) ;
211211
212+ it ( 'should merge pagination classNames and styles' , ( ) => {
213+ const { container } = render (
214+ < Table
215+ columns = { [ { dataIndex : 'name' } ] }
216+ dataSource = { [
217+ { key : '1' , name : 'Bamboo' } ,
218+ { key : '2' , name : 'Little' } ,
219+ ] }
220+ classNames = { {
221+ pagination : {
222+ root : 'table-pagination-root' ,
223+ item : 'table-pagination-item' ,
224+ } ,
225+ } }
226+ styles = { {
227+ pagination : {
228+ root : {
229+ backgroundColor : 'rgb(0, 0, 255)' ,
230+ color : 'rgb(0, 0, 0)' ,
231+ } ,
232+ item : {
233+ backgroundColor : 'rgb(0, 255, 0)' ,
234+ color : 'rgb(0, 0, 0)' ,
235+ } ,
236+ } ,
237+ } }
238+ pagination = { {
239+ pageSize : 1 ,
240+ classNames : {
241+ root : 'pagination-root' ,
242+ item : 'pagination-item' ,
243+ } ,
244+ styles : {
245+ root : {
246+ color : 'rgb(255, 0, 0)' ,
247+ borderTopWidth : '1px' ,
248+ } ,
249+ item : {
250+ color : 'rgb(255, 165, 0)' ,
251+ borderLeftWidth : '2px' ,
252+ } ,
253+ } ,
254+ } }
255+ /> ,
256+ ) ;
257+
258+ const paginationRoot = container . querySelector ( '.ant-pagination' ) ;
259+ const paginationItem = container . querySelector ( '.ant-pagination-item' ) ;
260+
261+ expect ( paginationRoot ) . toHaveClass ( 'table-pagination-root' , 'pagination-root' ) ;
262+ expect ( paginationRoot ) . toHaveStyle ( {
263+ backgroundColor : 'rgb(0, 0, 255)' ,
264+ color : 'rgb(0, 0, 0)' ,
265+ borderTopWidth : '1px' ,
266+ } ) ;
267+ expect ( paginationItem ) . toHaveClass ( 'table-pagination-item' , 'pagination-item' ) ;
268+ expect ( paginationItem ) . toHaveStyle ( {
269+ backgroundColor : 'rgb(0, 255, 0)' ,
270+ color : 'rgb(0, 0, 0)' ,
271+ borderLeftWidth : '2px' ,
272+ } ) ;
273+ } ) ;
274+
212275 it ( 'should work with function classNames and styles' , ( ) => {
213276 const columns = [
214277 {
0 commit comments