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>({
58
58
59
59
return (
60
60
< 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
+ />
62
66
< Header
63
67
{ ...props }
64
68
stickyOffsets = { headerStickyOffsets }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { mount } from 'enzyme' ;
3
3
import { act } from 'react-dom/test-utils' ;
4
- import Table from '../src' ;
4
+ import Table , { INTERNAL_COL_DEFINE } from '../src' ;
5
5
6
6
describe ( 'Table.FixedHeader' , ( ) => {
7
7
it ( 'switch column' , ( ) => {
@@ -64,4 +64,37 @@ describe('Table.FixedHeader', () => {
64
64
65
65
jest . useRealTimers ( ) ;
66
66
} ) ;
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
+ } ) ;
67
100
} ) ;
You can’t perform that action at this time.
0 commit comments