You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(uiGridAutoResize): Replaced timeout checker with watcher (#6470)
* fix(uiGridAutoResize): Replaced timeout checker for grid width and height change with watcher
* test(ui.grid.autoResizeGrid): Added some new test for auto-resize-grid
describe('on grid element height change to greater',function(){
58
+
varh;
59
+
beforeEach(function(done){
60
+
h=$(viewportElm).height();
61
+
62
+
$(gridElm).height(400);
63
+
$scope.$digest();
64
+
setTimeout(done,300);
65
+
});
66
+
it('adjusts the grid viewport size',function(){
67
+
varnewH=$(viewportElm).height();
68
+
expect(newH).toBeGreaterThan(h);
69
+
});
70
+
});
71
+
72
+
describe('on grid element width change to smaller',function(){
73
+
varw;
74
+
beforeEach(function(done){
75
+
w=$(viewportElm).width();
76
+
77
+
$(gridElm).width(400);
78
+
$scope.$digest();
79
+
setTimeout(done,300);
80
+
});
81
+
it('adjusts the grid viewport size',function(){
82
+
varnewW=$(viewportElm).width();
83
+
expect(newW).toBeLessThan(w);
84
+
});
85
+
});
86
+
87
+
describe('on grid element height change to smaller',function(){
88
+
varh;
89
+
beforeEach(function(done){
90
+
h=$(viewportElm).height();
91
+
92
+
$(gridElm).height(200);
93
+
$scope.$digest();
94
+
setTimeout(done,300);
95
+
});
96
+
it('adjusts the grid viewport size',function(){
97
+
varnewH=$(viewportElm).height();
98
+
expect(newH).toBeLessThan(h);
99
+
});
100
+
});
101
+
102
+
// Rebuild the grid as having 100% width and 100% height and being in a 400px wide and 300px height container, then change the container width to 500px and make sure it adjusts
103
+
describe('on grid container width change to greater',function(){
@@ -73,7 +117,6 @@ describe('ui.grid.autoResizeGrid', function () {
73
117
viewportElm=$(gridElm).find('.ui-grid-viewport');
74
118
75
119
w=$(viewportElm).width();
76
-
varh=$(viewportElm).height();
77
120
78
121
$(gridContainerElm).width(500);
79
122
$scope.$digest();
@@ -87,4 +130,98 @@ describe('ui.grid.autoResizeGrid', function () {
87
130
});
88
131
});
89
132
133
+
// Rebuild the grid as having 100% width and 100% height and being in a 400px wide and 300px height container, then change the container height to 400px and make sure it adjusts
134
+
describe('on grid container height change to greater',function(){
// Rebuild the grid as having 100% width and 100% height and being in a 400px wide and 300px height container, then change the container width to 300px and make sure it adjusts
166
+
describe('on grid container width change to smaller',function(){
// Rebuild the grid as having 100% width and 100% height and being in a 400px wide and 300px height container, then change the container height to 200px and make sure it adjusts
197
+
describe('on grid container height change to smaller',function(){
0 commit comments