File tree Expand file tree Collapse file tree 2 files changed +39
-2
lines changed
Expand file tree Collapse file tree 2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,11 @@ function FixedHeader<RecordType>({
5858
5959 return (
6060 < table style = { { tableLayout : 'fixed' , visibility : columnWidthsReady ? null : 'hidden' } } >
61- < ColGroup colWidths = { [ ...colWidths , scrollbarSize ] } columCount = { columCount + 1 } />
61+ < ColGroup
62+ colWidths = { [ ...colWidths , scrollbarSize ] }
63+ columCount = { columCount + 1 }
64+ columns = { flattenColumnsWithScrollbar }
65+ />
6266 < Header
6367 { ...props }
6468 stickyOffsets = { headerStickyOffsets }
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { mount } from 'enzyme' ;
33import { act } from 'react-dom/test-utils' ;
4- import Table from '../src' ;
4+ import Table , { INTERNAL_COL_DEFINE } from '../src' ;
55
66describe ( 'Table.FixedHeader' , ( ) => {
77 it ( 'switch column' , ( ) => {
@@ -64,4 +64,37 @@ describe('Table.FixedHeader', () => {
6464
6565 jest . useRealTimers ( ) ;
6666 } ) ;
67+
68+ it ( 'INTERNAL_COL_DEFINE' , ( ) => {
69+ const col1 = {
70+ dataIndex : 'light' ,
71+ width : 100 ,
72+ [ INTERNAL_COL_DEFINE ] : { className : 'test-internal' } ,
73+ } ;
74+ const col2 = { dataIndex : 'bamboo' , width : 200 } ;
75+ const wrapper = mount (
76+ < Table
77+ columns = { [ col1 , col2 ] }
78+ data = { [ { light : 'bamboo' , bamboo : 'light' , key : 1 } ] }
79+ scroll = { { y : 10 } }
80+ /> ,
81+ ) ;
82+
83+ expect (
84+ wrapper
85+ . find ( 'table' )
86+ . last ( )
87+ . find ( 'colgroup col' )
88+ . first ( )
89+ . props ( ) . className ,
90+ ) . toEqual ( 'test-internal' ) ;
91+ expect (
92+ wrapper
93+ . find ( 'table' )
94+ . first ( )
95+ . find ( 'colgroup col' )
96+ . first ( )
97+ . props ( ) . className ,
98+ ) . toEqual ( 'test-internal' ) ;
99+ } ) ;
67100} ) ;
You can’t perform that action at this time.
0 commit comments