@@ -14,7 +14,7 @@ describe('gridstack engine:', function() {
14
14
expect ( typeof GridStackEngine ) . toBe ( 'function' ) ;
15
15
} ) ;
16
16
17
- describe ( 'test constructor, ' , function ( ) {
17
+ describe ( 'test constructor > ' , function ( ) {
18
18
19
19
it ( 'should be setup properly' , function ( ) {
20
20
ePriv = e = new GridStackEngine ( ) ;
@@ -49,7 +49,7 @@ describe('gridstack engine:', function() {
49
49
} ) ;
50
50
} ) ;
51
51
52
- describe ( 'test prepareNode, ' , function ( ) {
52
+ describe ( 'test prepareNode > ' , function ( ) {
53
53
54
54
beforeAll ( function ( ) {
55
55
ePriv = e = new GridStackEngine ( ) ;
@@ -72,7 +72,7 @@ describe('gridstack engine:', function() {
72
72
} ) ;
73
73
} ) ;
74
74
75
- describe ( 'sorting of nodes, ' , function ( ) {
75
+ describe ( 'sorting of nodes > ' , function ( ) {
76
76
beforeAll ( function ( ) {
77
77
ePriv = e = new GridStackEngine ( ) ;
78
78
e . nodes = [ { x : 7 , y : 0 } , { x : 4 , y : 4 } , { x : 9 , y : 0 } , { x : 0 , y : 1 } ] ;
@@ -102,7 +102,7 @@ describe('gridstack engine:', function() {
102
102
103
103
} ) ;
104
104
105
- describe ( 'test isAreaEmpty, ' , function ( ) {
105
+ describe ( 'test isAreaEmpty > ' , function ( ) {
106
106
107
107
beforeAll ( function ( ) {
108
108
ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -122,7 +122,7 @@ describe('gridstack engine:', function() {
122
122
} ) ;
123
123
} ) ;
124
124
125
- describe ( 'test cleanNodes/getDirtyNodes, ' , function ( ) {
125
+ describe ( 'test cleanNodes/getDirtyNodes > ' , function ( ) {
126
126
127
127
beforeAll ( function ( ) {
128
128
ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -156,7 +156,7 @@ describe('gridstack engine:', function() {
156
156
} ) ;
157
157
} ) ;
158
158
159
- describe ( 'test batchUpdate/commit, ' , function ( ) {
159
+ describe ( 'test batchUpdate/commit > ' , function ( ) {
160
160
beforeAll ( function ( ) {
161
161
ePriv = e = new GridStackEngine ( ) ;
162
162
} ) ;
@@ -184,7 +184,7 @@ describe('gridstack engine:', function() {
184
184
} ) ;
185
185
} ) ;
186
186
187
- describe ( 'test batchUpdate/commit, ' , function ( ) {
187
+ describe ( 'test batchUpdate/commit > ' , function ( ) {
188
188
189
189
beforeAll ( function ( ) {
190
190
ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -201,7 +201,7 @@ describe('gridstack engine:', function() {
201
201
} ) ;
202
202
} ) ;
203
203
204
- describe ( 'test _notify, ' , function ( ) {
204
+ describe ( 'test _notify > ' , function ( ) {
205
205
let spy ;
206
206
207
207
beforeEach ( function ( ) {
@@ -235,8 +235,8 @@ describe('gridstack engine:', function() {
235
235
} ) ;
236
236
} ) ;
237
237
238
- describe ( 'test _packNodes, ' , function ( ) {
239
- describe ( 'using float:false mode, ' , function ( ) {
238
+ describe ( 'test _packNodes > ' , function ( ) {
239
+ describe ( 'using float:false mode > ' , function ( ) {
240
240
beforeEach ( function ( ) {
241
241
ePriv = e = new GridStackEngine ( { float :false } ) ;
242
242
} ) ;
@@ -291,7 +291,7 @@ describe('gridstack engine:', function() {
291
291
} ) ;
292
292
} ) ;
293
293
294
- describe ( 'test changedPos, ' , function ( ) {
294
+ describe ( 'test changedPos > ' , function ( ) {
295
295
beforeAll ( function ( ) {
296
296
ePriv = e = new GridStackEngine ( ) ;
297
297
} ) ;
@@ -317,7 +317,7 @@ describe('gridstack engine:', function() {
317
317
} ) ;
318
318
} ) ;
319
319
320
- describe ( 'test locked widget, ' , function ( ) {
320
+ describe ( 'test locked widget > ' , function ( ) {
321
321
beforeAll ( function ( ) {
322
322
ePriv = e = new GridStackEngine ( ) ;
323
323
} ) ;
@@ -352,54 +352,48 @@ describe('gridstack engine:', function() {
352
352
} ) ;
353
353
} ) ;
354
354
355
- describe ( 'test columnChanged and save, ' , function ( ) {
355
+ describe ( 'test columnChanged > ' , function ( ) {
356
356
beforeAll ( function ( ) {
357
357
} ) ;
358
- it ( 'wont\'t break layouts with 12 columns ' , function ( ) {
358
+ it ( '12 to 1 and back ' , function ( ) {
359
359
ePriv = e = new GridStackEngine ( { column : 12 } ) ;
360
360
// Add two side-by-side components 6+6 = 12 columns
361
- e . addNode ( { x : 0 , y : 0 , w : 6 , h : 1 , id : 'left' } ) ;
362
- e . addNode ( { x : 6 , y : 0 , w : 6 , h : 1 , id : 'right' } ) ;
363
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
364
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 6 , h : 1 } ) ) ;
365
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 6 , y : 0 , w : 6 , h : 1 } ) ) ;
361
+ const left = e . addNode ( { x : 0 , y : 0 , w : 6 , h : 1 , id : 'left' } ) ;
362
+ const right = e . addNode ( { x : 6 , y : 0 , w : 6 , h : 1 , id : 'right' } ) ;
363
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 6 , h : 1 } ) ) ;
364
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 6 , y : 0 , w : 6 , h : 1 } ) ) ;
366
365
// Resize to 1 column
367
366
e . column = 1 ;
368
367
e . columnChanged ( 12 , 1 ) ;
369
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
370
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 1 , h : 1 } ) ) ;
371
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 1 , w : 1 , h : 1 } ) ) ;
368
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 1 , h : 1 } ) ) ;
369
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 1 , w : 1 , h : 1 } ) ) ;
372
370
// Resize back to 12 column
373
371
e . column = 12 ;
374
372
e . columnChanged ( 1 , 12 ) ;
375
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
376
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 6 , h : 1 } ) ) ;
377
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 6 , y : 0 , w : 6 , h : 1 } ) ) ;
373
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 6 , h : 1 } ) ) ;
374
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 6 , y : 0 , w : 6 , h : 1 } ) ) ;
378
375
} ) ;
379
- it ( 'wont\'t break layouts with more than 12 columns ' , function ( ) {
376
+ it ( '24 column to 1 and back ' , function ( ) {
380
377
ePriv = e = new GridStackEngine ( { column : 24 } ) ;
381
378
// Add two side-by-side components 12+12 = 24 columns
382
- e . addNode ( { x : 0 , y : 0 , w : 12 , h : 1 , id : 'left' } ) ;
383
- e . addNode ( { x : 12 , y : 0 , w : 12 , h : 1 , id : 'right' } ) ;
384
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
385
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 12 , h : 1 } ) ) ;
386
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 12 , y : 0 , w : 12 , h : 1 } ) ) ;
379
+ const left = e . addNode ( { x : 0 , y : 0 , w : 12 , h : 1 , id : 'left' } ) ;
380
+ const right = e . addNode ( { x : 12 , y : 0 , w : 12 , h : 1 , id : 'right' } ) ;
381
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 12 , h : 1 } ) ) ;
382
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 12 , y : 0 , w : 12 , h : 1 } ) ) ;
387
383
// Resize to 1 column
388
384
e . column = 1 ;
389
385
e . columnChanged ( 24 , 1 ) ;
390
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
391
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 1 , h : 1 } ) ) ;
392
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 1 , w : 1 , h : 1 } ) ) ;
386
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 1 , h : 1 } ) ) ;
387
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 1 , w : 1 , h : 1 } ) ) ;
393
388
// Resize back to 24 column
394
389
e . column = 24 ;
395
390
e . columnChanged ( 1 , 24 ) ;
396
- e . save ( ) . forEach ( node => e . nodeBoundFix ( findNode ( node . id ! ) ! ) ) ;
397
- expect ( findNode ( 'left' ) ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 12 , h : 1 } ) ) ;
398
- expect ( findNode ( 'right' ) ) . toEqual ( jasmine . objectContaining ( { x : 12 , y : 0 , w : 12 , h : 1 } ) ) ;
391
+ expect ( left ) . toEqual ( jasmine . objectContaining ( { x : 0 , y : 0 , w : 12 , h : 1 } ) ) ;
392
+ expect ( right ) . toEqual ( jasmine . objectContaining ( { x : 12 , y : 0 , w : 12 , h : 1 } ) ) ;
399
393
} ) ;
400
394
} ) ;
401
395
402
- describe ( 'test compact, ' , function ( ) {
396
+ describe ( 'test compact > ' , function ( ) {
403
397
beforeAll ( function ( ) {
404
398
ePriv = e = new GridStackEngine ( ) ;
405
399
} ) ;
0 commit comments