@@ -162,20 +162,20 @@ describe('ui.grid.edit uiGridCellNavService', function () {
162
162
163
163
describe ( 'scrollTo' , function ( ) {
164
164
/*
165
- * We have 11 rows (10 visible) and 11 columns (10 visible). The column widths are
165
+ * We have 11 rows (10 visible) and 11 columns (10 visible). The column widths are
166
166
* 100 for the first 5, and 200 for the second 5. Column 2 and row 2 are invisible.
167
167
*/
168
168
var evt ;
169
169
var args ;
170
170
var $scope ;
171
-
171
+
172
172
beforeEach ( function ( ) {
173
173
var i , j , row ;
174
174
grid . options . columnDefs = [ ] ;
175
175
for ( i = 0 ; i < 11 ; i ++ ) {
176
176
grid . options . columnDefs . push ( { name : 'col' + i } ) ;
177
177
}
178
-
178
+
179
179
grid . options . data = [ ] ;
180
180
for ( i = 0 ; i < 11 ; i ++ ) {
181
181
row = { } ;
@@ -184,16 +184,16 @@ describe('ui.grid.edit uiGridCellNavService', function () {
184
184
}
185
185
grid . options . data . push ( row ) ;
186
186
}
187
-
187
+
188
188
uiGridCellNavService . initializeGrid ( grid ) ;
189
- grid . modifyRows ( grid . options . data ) ;
190
-
189
+ grid . modifyRows ( grid . options . data ) ;
190
+
191
191
grid . registerColumnBuilder ( uiGridCellNavService . cellNavColumnBuilder ) ;
192
192
grid . buildColumns ( ) ;
193
-
193
+
194
194
grid . columns [ 2 ] . visible = false ;
195
195
grid . rows [ 2 ] . visible = false ;
196
-
196
+
197
197
grid . setVisibleColumns ( grid . columns ) ;
198
198
grid . setVisibleRows ( grid . rows ) ;
199
199
@@ -202,14 +202,14 @@ describe('ui.grid.edit uiGridCellNavService', function () {
202
202
for ( i = 0 ; i < 11 ; i ++ ) {
203
203
grid . columns [ i ] . drawnWidth = i < 6 ? 100 : 200 ;
204
204
}
205
-
205
+
206
206
$scope = $rootScope . $new ( ) ;
207
207
208
208
args = null ;
209
209
grid . api . core . on . scrollEnd ( $scope , function ( receivedArgs ) {
210
210
args = receivedArgs ;
211
211
} ) ;
212
-
212
+
213
213
} ) ;
214
214
215
215
@@ -232,7 +232,7 @@ describe('ui.grid.edit uiGridCellNavService', function () {
232
232
grid . scrollTo ( grid . options . data [ 0 ] , null ) ;
233
233
} ) ;
234
234
$timeout . flush ( ) ;
235
-
235
+
236
236
expect ( Math . round ( args . y . percentage * 10 ) / 10 ) . toBe ( 0.1 ) ;
237
237
} ) ;
238
238
@@ -241,7 +241,7 @@ describe('ui.grid.edit uiGridCellNavService', function () {
241
241
grid . scrollTo ( grid . options . data [ 10 ] , null ) ;
242
242
} ) ;
243
243
$timeout . flush ( ) ;
244
-
244
+
245
245
expect ( args . y . percentage ) . toBeGreaterThan ( 0.5 ) ;
246
246
expect ( args . x ) . toBe ( null ) ;
247
247
} ) ;
@@ -251,7 +251,7 @@ describe('ui.grid.edit uiGridCellNavService', function () {
251
251
grid . scrollTo ( grid . options . data [ 5 ] , null ) ;
252
252
} ) ;
253
253
$timeout . flush ( ) ;
254
-
254
+
255
255
expect ( Math . round ( args . y . percentage * 10 ) / 10 ) . toEqual ( 0.5 ) ;
256
256
expect ( args . x ) . toBe ( null ) ;
257
257
} ) ;
@@ -281,7 +281,7 @@ describe('ui.grid.edit uiGridCellNavService', function () {
281
281
grid . scrollTo ( null , grid . columns [ 8 ] . colDef ) ;
282
282
} ) ;
283
283
$timeout . flush ( ) ;
284
-
284
+
285
285
expect ( isNaN ( args . x . percentage ) ) . toEqual ( true ) ;
286
286
} ) ;
287
287
@@ -290,8 +290,8 @@ describe('ui.grid.edit uiGridCellNavService', function () {
290
290
grid . scrollTo ( null , null ) ;
291
291
} ) ;
292
292
$timeout . flush ( ) ;
293
-
293
+
294
294
expect ( args ) . toEqual ( null ) ;
295
295
} ) ;
296
296
} ) ;
297
- } ) ;
297
+ } ) ;
0 commit comments