@@ -14,7 +14,7 @@ describe('gridstack engine:', function() {
1414 expect ( typeof GridStackEngine ) . toBe ( 'function' ) ;
1515 } ) ;
1616
17- describe ( 'test constructor, ' , function ( ) {
17+ describe ( 'test constructor > ' , function ( ) {
1818
1919 it ( 'should be setup properly' , function ( ) {
2020 ePriv = e = new GridStackEngine ( ) ;
@@ -49,7 +49,7 @@ describe('gridstack engine:', function() {
4949 } ) ;
5050 } ) ;
5151
52- describe ( 'test prepareNode, ' , function ( ) {
52+ describe ( 'test prepareNode > ' , function ( ) {
5353
5454 beforeAll ( function ( ) {
5555 ePriv = e = new GridStackEngine ( ) ;
@@ -72,7 +72,7 @@ describe('gridstack engine:', function() {
7272 } ) ;
7373 } ) ;
7474
75- describe ( 'sorting of nodes, ' , function ( ) {
75+ describe ( 'sorting of nodes > ' , function ( ) {
7676 beforeAll ( function ( ) {
7777 ePriv = e = new GridStackEngine ( ) ;
7878 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() {
102102
103103 } ) ;
104104
105- describe ( 'test isAreaEmpty, ' , function ( ) {
105+ describe ( 'test isAreaEmpty > ' , function ( ) {
106106
107107 beforeAll ( function ( ) {
108108 ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -122,7 +122,7 @@ describe('gridstack engine:', function() {
122122 } ) ;
123123 } ) ;
124124
125- describe ( 'test cleanNodes/getDirtyNodes, ' , function ( ) {
125+ describe ( 'test cleanNodes/getDirtyNodes > ' , function ( ) {
126126
127127 beforeAll ( function ( ) {
128128 ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -156,7 +156,7 @@ describe('gridstack engine:', function() {
156156 } ) ;
157157 } ) ;
158158
159- describe ( 'test batchUpdate/commit, ' , function ( ) {
159+ describe ( 'test batchUpdate/commit > ' , function ( ) {
160160 beforeAll ( function ( ) {
161161 ePriv = e = new GridStackEngine ( ) ;
162162 } ) ;
@@ -184,7 +184,7 @@ describe('gridstack engine:', function() {
184184 } ) ;
185185 } ) ;
186186
187- describe ( 'test batchUpdate/commit, ' , function ( ) {
187+ describe ( 'test batchUpdate/commit > ' , function ( ) {
188188
189189 beforeAll ( function ( ) {
190190 ePriv = e = new GridStackEngine ( { float :true } ) ;
@@ -201,7 +201,7 @@ describe('gridstack engine:', function() {
201201 } ) ;
202202 } ) ;
203203
204- describe ( 'test _notify, ' , function ( ) {
204+ describe ( 'test _notify > ' , function ( ) {
205205 let spy ;
206206
207207 beforeEach ( function ( ) {
@@ -235,8 +235,8 @@ describe('gridstack engine:', function() {
235235 } ) ;
236236 } ) ;
237237
238- describe ( 'test _packNodes, ' , function ( ) {
239- describe ( 'using float:false mode, ' , function ( ) {
238+ describe ( 'test _packNodes > ' , function ( ) {
239+ describe ( 'using float:false mode > ' , function ( ) {
240240 beforeEach ( function ( ) {
241241 ePriv = e = new GridStackEngine ( { float :false } ) ;
242242 } ) ;
@@ -291,7 +291,7 @@ describe('gridstack engine:', function() {
291291 } ) ;
292292 } ) ;
293293
294- describe ( 'test changedPos, ' , function ( ) {
294+ describe ( 'test changedPos > ' , function ( ) {
295295 beforeAll ( function ( ) {
296296 ePriv = e = new GridStackEngine ( ) ;
297297 } ) ;
@@ -317,7 +317,7 @@ describe('gridstack engine:', function() {
317317 } ) ;
318318 } ) ;
319319
320- describe ( 'test locked widget, ' , function ( ) {
320+ describe ( 'test locked widget > ' , function ( ) {
321321 beforeAll ( function ( ) {
322322 ePriv = e = new GridStackEngine ( ) ;
323323 } ) ;
@@ -352,54 +352,48 @@ describe('gridstack engine:', function() {
352352 } ) ;
353353 } ) ;
354354
355- describe ( 'test columnChanged and save, ' , function ( ) {
355+ describe ( 'test columnChanged > ' , function ( ) {
356356 beforeAll ( function ( ) {
357357 } ) ;
358- it ( 'wont\'t break layouts with 12 columns ' , function ( ) {
358+ it ( '12 to 1 and back ' , function ( ) {
359359 ePriv = e = new GridStackEngine ( { column : 12 } ) ;
360360 // 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 } ) ) ;
366365 // Resize to 1 column
367366 e . column = 1 ;
368367 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 } ) ) ;
372370 // Resize back to 12 column
373371 e . column = 12 ;
374372 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 } ) ) ;
378375 } ) ;
379- it ( 'wont\'t break layouts with more than 12 columns ' , function ( ) {
376+ it ( '24 column to 1 and back ' , function ( ) {
380377 ePriv = e = new GridStackEngine ( { column : 24 } ) ;
381378 // 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 } ) ) ;
387383 // Resize to 1 column
388384 e . column = 1 ;
389385 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 } ) ) ;
393388 // Resize back to 24 column
394389 e . column = 24 ;
395390 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 } ) ) ;
399393 } ) ;
400394 } ) ;
401395
402- describe ( 'test compact, ' , function ( ) {
396+ describe ( 'test compact > ' , function ( ) {
403397 beforeAll ( function ( ) {
404398 ePriv = e = new GridStackEngine ( ) ;
405399 } ) ;
0 commit comments