File tree Expand file tree Collapse file tree 2 files changed +42
-29
lines changed Expand file tree Collapse file tree 2 files changed +42
-29
lines changed Original file line number Diff line number Diff line change 1
1
import { mount } from 'enzyme' ;
2
2
import RcResizeObserver from 'rc-resize-observer' ;
3
- import { spyElementPrototype } from 'rc-util/lib/test/domHook' ;
3
+ import { spyElementPrototypes } from 'rc-util/lib/test/domHook' ;
4
4
import { resetWarned } from 'rc-util/lib/warning' ;
5
5
import { act } from 'react-dom/test-utils' ;
6
6
import Table from '../src' ;
@@ -9,8 +9,13 @@ describe('Table.FixedColumn', () => {
9
9
let domSpy ;
10
10
11
11
beforeAll ( ( ) => {
12
- domSpy = spyElementPrototype ( HTMLElement , 'offsetParent' , {
13
- get : ( ) => ( { } ) ,
12
+ domSpy = spyElementPrototypes ( HTMLElement , {
13
+ offsetParent : {
14
+ get : ( ) => ( { } ) ,
15
+ } ,
16
+ offsetWidth : {
17
+ get : ( ) => 1000 ,
18
+ } ,
14
19
} ) ;
15
20
} ) ;
16
21
@@ -65,6 +70,10 @@ describe('Table.FixedColumn', () => {
65
70
jest . useFakeTimers ( ) ;
66
71
const wrapper = mount ( < Table columns = { columns } data = { testData } scroll = { scroll } /> ) ;
67
72
73
+ act ( ( ) => {
74
+ wrapper . find ( RcResizeObserver ) . first ( ) . props ( ) . onResize ( { width : 100 } ) ;
75
+ } ) ;
76
+
68
77
act ( ( ) => {
69
78
wrapper
70
79
. find ( RcResizeObserver . Collection )
Original file line number Diff line number Diff line change @@ -1759,8 +1759,10 @@ exports[`Table.FixedColumn renders correctly scrollX - without data 1`] = `
1759
1759
>
1760
1760
<div
1761
1761
class = " rc-table-expanded-row-fixed"
1762
- style = " width: 0px; position: sticky; left: 0px; overflow: hidden;"
1763
- />
1762
+ style = " width: 1000px; position: sticky; left: 0px; overflow: hidden;"
1763
+ >
1764
+ No Data
1765
+ </div >
1764
1766
</td >
1765
1767
</tr >
1766
1768
</tbody >
@@ -1789,37 +1791,37 @@ exports[`Table.FixedColumn renders correctly scrollXY - with data 1`] = `
1789
1791
style = " width: 93px;"
1790
1792
/>
1791
1793
<col
1792
- style = " width: 0px ;"
1794
+ style = " width: 1000px ;"
1793
1795
/>
1794
1796
<col
1795
- style = " width: 0px ;"
1797
+ style = " width: 1000px ;"
1796
1798
/>
1797
1799
<col
1798
- style = " width: 0px ;"
1800
+ style = " width: 1000px ;"
1799
1801
/>
1800
1802
<col
1801
- style = " width: 0px ;"
1803
+ style = " width: 1000px ;"
1802
1804
/>
1803
1805
<col
1804
- style = " width: 0px ;"
1806
+ style = " width: 1000px ;"
1805
1807
/>
1806
1808
<col
1807
- style = " width: 0px ;"
1809
+ style = " width: 1000px ;"
1808
1810
/>
1809
1811
<col
1810
- style = " width: 0px ;"
1812
+ style = " width: 1000px ;"
1811
1813
/>
1812
1814
<col
1813
- style = " width: 0px ;"
1815
+ style = " width: 1000px ;"
1814
1816
/>
1815
1817
<col
1816
- style = " width: 0px ;"
1818
+ style = " width: 1000px ;"
1817
1819
/>
1818
1820
<col
1819
- style = " width: 0px ;"
1821
+ style = " width: 1000px ;"
1820
1822
/>
1821
1823
<col
1822
- style = " width: 0px ;"
1824
+ style = " width: 1000px ;"
1823
1825
/>
1824
1826
<col
1825
1827
style = " width: 15px;"
@@ -2620,37 +2622,37 @@ exports[`Table.FixedColumn renders correctly scrollXY - without data 1`] = `
2620
2622
style = " width: 93px;"
2621
2623
/>
2622
2624
<col
2623
- style = " width: 0px ;"
2625
+ style = " width: 1000px ;"
2624
2626
/>
2625
2627
<col
2626
- style = " width: 0px ;"
2628
+ style = " width: 1000px ;"
2627
2629
/>
2628
2630
<col
2629
- style = " width: 0px ;"
2631
+ style = " width: 1000px ;"
2630
2632
/>
2631
2633
<col
2632
- style = " width: 0px ;"
2634
+ style = " width: 1000px ;"
2633
2635
/>
2634
2636
<col
2635
- style = " width: 0px ;"
2637
+ style = " width: 1000px ;"
2636
2638
/>
2637
2639
<col
2638
- style = " width: 0px ;"
2640
+ style = " width: 1000px ;"
2639
2641
/>
2640
2642
<col
2641
- style = " width: 0px ;"
2643
+ style = " width: 1000px ;"
2642
2644
/>
2643
2645
<col
2644
- style = " width: 0px ;"
2646
+ style = " width: 1000px ;"
2645
2647
/>
2646
2648
<col
2647
- style = " width: 0px ;"
2649
+ style = " width: 1000px ;"
2648
2650
/>
2649
2651
<col
2650
- style = " width: 0px ;"
2652
+ style = " width: 1000px ;"
2651
2653
/>
2652
2654
<col
2653
- style = " width: 0px ;"
2655
+ style = " width: 1000px ;"
2654
2656
/>
2655
2657
<col
2656
2658
style = " width: 15px;"
@@ -2889,8 +2891,10 @@ exports[`Table.FixedColumn renders correctly scrollXY - without data 1`] = `
2889
2891
>
2890
2892
<div
2891
2893
class = " rc-table-expanded-row-fixed"
2892
- style = " width: -15px; position: sticky; left: 0px; overflow: hidden;"
2893
- />
2894
+ style = " width: 985px; position: sticky; left: 0px; overflow: hidden;"
2895
+ >
2896
+ No Data
2897
+ </div >
2894
2898
</td >
2895
2899
</tr >
2896
2900
</tbody >
You can’t perform that action at this time.
0 commit comments