@@ -66,6 +66,8 @@ class TestPanel implements IGridPanelView {
66
66
}
67
67
68
68
class ClassUnderTest extends BaseGrid < TestPanel > {
69
+ readonly gridview = this . gridview ;
70
+
69
71
constructor ( options : BaseGridOptions ) {
70
72
super ( options ) ;
71
73
}
@@ -103,6 +105,31 @@ class ClassUnderTest extends BaseGrid<TestPanel> {
103
105
}
104
106
105
107
describe ( 'baseComponentGridview' , ( ) => {
108
+ test ( 'that .layout(...) force flag works' , ( ) => {
109
+ const cut = new ClassUnderTest ( {
110
+ parentElement : document . createElement ( 'div' ) ,
111
+ orientation : Orientation . HORIZONTAL ,
112
+ proportionalLayout : true ,
113
+ } ) ;
114
+
115
+ const spy = jest . spyOn ( cut . gridview , 'layout' ) ;
116
+
117
+ cut . layout ( 100 , 100 ) ;
118
+ expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ;
119
+
120
+ cut . layout ( 100 , 100 , false ) ;
121
+ expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ;
122
+
123
+ cut . layout ( 100 , 100 , true ) ;
124
+ expect ( spy ) . toHaveBeenCalledTimes ( 2 ) ;
125
+
126
+ cut . layout ( 150 , 150 , false ) ;
127
+ expect ( spy ) . toHaveBeenCalledTimes ( 3 ) ;
128
+
129
+ cut . layout ( 150 , 150 , true ) ;
130
+ expect ( spy ) . toHaveBeenCalledTimes ( 4 ) ;
131
+ } ) ;
132
+
106
133
test ( 'can add group' , ( ) => {
107
134
const cut = new ClassUnderTest ( {
108
135
parentElement : document . createElement ( 'div' ) ,
0 commit comments