Skip to content

Commit 31f35ef

Browse files
author
Alain Dumesny
committed
test case for #1068
1 parent 65accb4 commit 31f35ef

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

doc/CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ Change log
2525

2626
## v0.5.3-dev (upcoming changes)
2727

28+
- fix for griditems with x=0 placement wrong order (introduced for #1017) ([#1054](https://github.com/gridstack/gridstack.js/issues/1054)).
29+
- fix `cellHeight(val)` not working due to style change caused by #937 fix ([#1068](https://github.com/gridstack/gridstack.js/issues/1068)).
2830
- add `gridstack.poly.js` for IE and older browsers, removed `core-js` lib from samples (<1k vs 85k), and all IE8 mentions ([#1061](https://github.com/gridstack/gridstack.js/pull/1061)).
2931
- add `jquery-ui.js` (and min.js) as minimal subset we need (55k vs 248k), which is now part of `gridstack.all.js`. Include individual parts if you need your own lib instead of all.js
3032
([#1064](https://github.com/gridstack/gridstack.js/pull/1064)).
3133
- changed jquery dependency to lowest we can use (>=1.8) ([#629](https://github.com/gridstack/gridstack.js/issues/629)).
32-
- fix for griditems with x=0 placement wrong order (introduced for #1017) ([#1054](https://github.com/gridstack/gridstack.js/issues/1054)).
3334

3435
## v0.5.3 (2019-11-20)
3536

spec/gridstack-spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,27 +247,27 @@ describe('gridstack', function() {
247247
afterEach(function() {
248248
document.body.removeChild(document.getElementById('gs-cont'));
249249
});
250-
it('should have no changes', function() {
250+
it('should start at 80 then become 120', function() {
251251
var options = {
252252
cellHeight: 80,
253253
verticalMargin: 10,
254254
column: 12
255255
};
256256
$('.grid-stack').gridstack(options);
257-
var grid = $('.grid-stack').data('gridstack');
257+
var container = $('.grid-stack');
258+
var grid = container.data('gridstack');
259+
var rows = container.attr('data-gs-current-height');
260+
261+
expect(grid.cellHeight()).toBe(80);
262+
expect(parseInt(container.css('height'))).toBe(rows * 80 + (rows-1) * 10);
263+
258264
grid.cellHeight( grid.cellHeight() );
259265
expect(grid.cellHeight()).toBe(80);
260-
});
261-
it('should change cellHeight to 120', function() {
262-
var options = {
263-
cellHeight: 80,
264-
verticalMargin: 10,
265-
column: 10
266-
};
267-
$('.grid-stack').gridstack(options);
268-
var grid = $('.grid-stack').data('gridstack');
266+
expect(parseInt(container.css('height'))).toBe(rows * 80 + (rows-1) * 10);
267+
269268
grid.cellHeight( 120 );
270269
expect(grid.cellHeight()).toBe(120);
270+
expect(parseInt(container.css('height'))).toBe(rows * 120 + (rows-1) * 10);
271271
});
272272
});
273273

0 commit comments

Comments
 (0)