@@ -8,7 +8,7 @@ fixture`Ai Column.ColumnResizing`
88const DATA_GRID_SELECTOR = '#container' ;
99
1010( [ 'nextColumn' , 'widget' ] as const ) . forEach ( ( columnResizingMode ) => {
11- test ( `Column resizing should work when allowColumnResizing is true and columnResizingMode = ${ columnResizingMode } ` , async ( t ) => {
11+ test ( `Column resizing should work when allowColumnResizing is true ( columnResizingMode = ${ columnResizingMode } ) ` , async ( t ) => {
1212 // arrange
1313 const dataGrid = new DataGrid ( DATA_GRID_SELECTOR ) ;
1414 const dataCell = dataGrid . getDataCell ( 0 , 0 ) ;
@@ -47,7 +47,7 @@ const DATA_GRID_SELECTOR = '#container';
4747 ] ,
4848 } ) ) ;
4949
50- test ( `Column resizing should work when allowResizing is true and columnResizingMode = ${ columnResizingMode } ` , async ( t ) => {
50+ test ( `Column resizing should work when allowResizing is true ( columnResizingMode = ${ columnResizingMode } ) ` , async ( t ) => {
5151 // arrange
5252 const dataGrid = new DataGrid ( DATA_GRID_SELECTOR ) ;
5353 const dataCell = dataGrid . getDataCell ( 0 , 0 ) ;
@@ -92,7 +92,7 @@ const DATA_GRID_SELECTOR = '#container';
9292 ] ,
9393 } ) ) ;
9494
95- test ( `Column resizing should not work when allowResizing is false and columnResizingMode = ${ columnResizingMode } ` , async ( t ) => {
95+ test ( `Column resizing should not work when allowResizing is false ( columnResizingMode = ${ columnResizingMode } ) ` , async ( t ) => {
9696 // arrange
9797 const dataGrid = new DataGrid ( DATA_GRID_SELECTOR ) ;
9898 const dataCell = dataGrid . getDataCell ( 0 , 0 ) ;
@@ -131,4 +131,44 @@ const DATA_GRID_SELECTOR = '#container';
131131 { dataField : 'value' , caption : 'Value' } ,
132132 ] ,
133133 } ) ) ;
134+
135+ test ( `The column width should not be less than its min width when column resizing (columnResizingMode = ${ columnResizingMode } )` , async ( t ) => {
136+ // arrange
137+ const dataGrid = new DataGrid ( DATA_GRID_SELECTOR ) ;
138+ const dataCell = dataGrid . getDataCell ( 0 , 0 ) ;
139+
140+ await t . expect ( dataGrid . isReady ( ) ) . ok ( ) ;
141+
142+ // assert
143+ await t
144+ . expect ( dataGrid . getHeaders ( ) . getHeaderRow ( 0 ) . getHeaderCell ( 0 ) . element . textContent )
145+ . eql ( 'AI Column' )
146+ . expect ( dataCell . element . clientWidth )
147+ . eql ( 100 ) ;
148+
149+ // act
150+ await dataGrid . resizeHeader ( 1 , - 50 ) ;
151+
152+ // assert
153+ await t . expect ( dataCell . element . clientWidth ) . eql ( 75 ) ;
154+ } ) . before ( async ( ) => createWidget ( 'dxDataGrid' , {
155+ dataSource : [
156+ { id : 1 , name : 'Name 1' , value : 10 } ,
157+ { id : 2 , name : 'Name 2' , value : 20 } ,
158+ { id : 3 , name : 'Name 3' , value : 30 } ,
159+ ] ,
160+ allowColumnResizing : true ,
161+ columnResizingMode,
162+ columnWidth : 100 ,
163+ columns : [
164+ {
165+ type : 'ai' ,
166+ caption : 'AI Column' ,
167+ minWidth : 75 ,
168+ } ,
169+ { dataField : 'id' , caption : 'ID' } ,
170+ { dataField : 'name' , caption : 'Name' } ,
171+ { dataField : 'value' , caption : 'Value' } ,
172+ ] ,
173+ } ) ) ;
134174} ) ;
0 commit comments