@@ -10,7 +10,6 @@ import { IPinningConfig } from '../common/grid.interface';
10
10
import { SampleTestData } from '../../test-utils/sample-test-data.spec' ;
11
11
import { IgxGridTransaction } from '../tree-grid' ;
12
12
import { IgxTransactionService } from '../../services' ;
13
- import { wait } from '../../test-utils/ui-interactions.spec' ;
14
13
15
14
describe ( 'Row Pinning #grid' , ( ) => {
16
15
const FIXED_ROW_CONTAINER = '.igx-grid__tr--pinned ' ;
@@ -223,7 +222,7 @@ describe('Row Pinning #grid', () => {
223
222
} ) ;
224
223
} ) ;
225
224
226
- describe ( ' Editing ' , ( ) => {
225
+ fdescribe ( ' Editing ' , ( ) => {
227
226
beforeEach ( fakeAsync ( ( ) => {
228
227
fix = TestBed . createComponent ( GridRowPinningWithTransactionsComponent ) ;
229
228
fix . detectChanges ( ) ;
@@ -232,46 +231,45 @@ describe('Row Pinning #grid', () => {
232
231
fix . detectChanges ( ) ;
233
232
} ) ) ;
234
233
235
- it ( 'should allow pinning edited/deleted/added row.' , async ( ) => {
236
- // test with added row
237
- grid . addRow ( { 'ID' : 'Test' , 'CompanyName' : 'Test' } ) ;
234
+ it ( 'should allow pinning edited row.' , ( ) => {
235
+ grid . updateCell ( 'New value' , 'ANTON' , 'CompanyName' ) ;
238
236
fix . detectChanges ( ) ;
239
-
240
- grid . pinRow ( 'Test' ) ;
237
+ grid . pinRow ( 'ANTON' ) ;
241
238
fix . detectChanges ( ) ;
239
+
242
240
expect ( grid . pinnedRows . length ) . toBe ( 1 ) ;
243
- let pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
241
+ const pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
244
242
expect ( pinRowContainer . length ) . toBe ( 1 ) ;
245
243
expect ( pinRowContainer [ 0 ] . children . length ) . toBe ( 1 ) ;
246
- expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowID ) . toBe ( 'Test' ) ;
244
+ expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowID ) . toBe ( 'ANTON' ) ;
245
+ expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowData . CompanyName ) . toBe ( 'New value' ) ;
246
+ } ) ;
247
247
248
- // test with deleted row
248
+ it ( 'should allow pinning deleted row.' , ( ) => {
249
249
grid . deleteRow ( 'ALFKI' ) ;
250
250
fix . detectChanges ( ) ;
251
251
grid . pinRow ( 'ALFKI' ) ;
252
252
fix . detectChanges ( ) ;
253
253
254
- expect ( grid . pinnedRows . length ) . toBe ( 2 ) ;
255
- pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
254
+ expect ( grid . pinnedRows . length ) . toBe ( 1 ) ;
255
+ const pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
256
256
expect ( pinRowContainer . length ) . toBe ( 1 ) ;
257
- expect ( pinRowContainer [ 0 ] . children . length ) . toBe ( 2 ) ;
258
- expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowID ) . toBe ( 'Test ' ) ;
259
- expect ( pinRowContainer [ 0 ] . children [ 1 ] . context . rowID ) . toBe ( 'ALFKI' ) ;
257
+ expect ( pinRowContainer [ 0 ] . children . length ) . toBe ( 1 ) ;
258
+ expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowID ) . toBe ( 'ALFKI ' ) ;
259
+ } ) ;
260
260
261
- // test with edited
262
- grid . updateCell ( 'New value' , 'ANTON' , 'CompanyName' ) ;
263
- fix . detectChanges ( ) ;
264
- grid . pinRow ( 'ANTON' ) ;
265
- fix . detectChanges ( ) ;
266
- await wait ( 100 ) ;
261
+ it ( 'should allow pinning added row.' , ( ) => {
262
+
263
+ grid . addRow ( { 'ID' : 'Test' , 'CompanyName' : 'Test' } ) ;
267
264
fix . detectChanges ( ) ;
268
265
269
- expect ( grid . pinnedRows . length ) . toBe ( 3 ) ;
270
- pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
266
+ grid . pinRow ( 'Test' ) ;
267
+ fix . detectChanges ( ) ;
268
+ expect ( grid . pinnedRows . length ) . toBe ( 1 ) ;
269
+ const pinRowContainer = fix . debugElement . queryAll ( By . css ( FIXED_ROW_CONTAINER ) ) ;
271
270
expect ( pinRowContainer . length ) . toBe ( 1 ) ;
272
- expect ( pinRowContainer [ 0 ] . children . length ) . toBe ( 3 ) ;
273
- expect ( pinRowContainer [ 0 ] . children [ 2 ] . context . rowID ) . toBe ( 'ANTON' ) ;
274
- expect ( pinRowContainer [ 0 ] . children [ 2 ] . context . rowData . CompanyName ) . toBe ( 'New value' ) ;
271
+ expect ( pinRowContainer [ 0 ] . children . length ) . toBe ( 1 ) ;
272
+ expect ( pinRowContainer [ 0 ] . children [ 0 ] . context . rowID ) . toBe ( 'Test' ) ;
275
273
} ) ;
276
274
277
275
it ( 'should stop editing when edited row is pinned/unpinned.' , ( ) => {
0 commit comments