it('should log a warning if set_static is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.set_static(true);
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `set_static` is deprecated as of v0.2.5 and has been replaced with `setStatic`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _set_static_class is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._set_static_class();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_set_static_class` is deprecated as of v0.2.5 and has been replaced with `_setStaticClass`. It will be **completely** removed in v1.0.');
});
it('should log a warning if is_area_empty is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.is_area_empty(1,1,1,1);
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `is_area_empty` is deprecated as of v0.2.5 and has been replaced with `isAreaEmpty`. It will be **completely** removed in v1.0.');
});
it('should log a warning if batch_update is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.batch_update();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `batch_update` is deprecated as of v0.2.5 and has been replaced with `batchUpdate`. It will be **completely** removed in v1.0.');
});
it('should log a warning if get_cell_from_pixel is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varpixel={top:100,left:72};
grid.get_cell_from_pixel(pixel);
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `get_cell_from_pixel` is deprecated as of v0.2.5 and has been replaced with `getCellFromPixel`. It will be **completely** removed in v1.0.');
});
it('should log a warning if cell_width is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.cell_width();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `cell_width` is deprecated as of v0.2.5 and has been replaced with `cellWidth`. It will be **completely** removed in v1.0.');
});
it('should log a warning if cell_height is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.cell_height();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `cell_height` is deprecated as of v0.2.5 and has been replaced with `cellHeight`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _update_element is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._update_element();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_element` is deprecated as of v0.2.5 and has been replaced with `_updateElement`. It will be **completely** removed in v1.0.');
});
it('should log a warning if min_width is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid.min_width(items[i],2);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `min_width` is deprecated as of v0.2.5 and has been replaced with `minWidth`. It will be **completely** removed in v1.0.');
});
it('should log a warning if min_height is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid.min_height(items[i],2);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `min_height` is deprecated as of v0.2.5 and has been replaced with `minHeight`. It will be **completely** removed in v1.0.');
});
it('should log a warning if remove_all is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.remove_all();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `remove_all` is deprecated as of v0.2.5 and has been replaced with `removeAll`. It will be **completely** removed in v1.0.');
});
it('should log a warning if remove_widget is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid.remove_widget(items[i]);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `remove_widget` is deprecated as of v0.2.5 and has been replaced with `removeWidget`. It will be **completely** removed in v1.0.');
});
it('should log a warning if will_it_fit is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.will_it_fit(0,0,1,1,false);
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `will_it_fit` is deprecated as of v0.2.5 and has been replaced with `willItFit`. It will be **completely** removed in v1.0.');
});
it('should log a warning if make_widget is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid.make_widget(items[i]);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `make_widget` is deprecated as of v0.2.5 and has been replaced with `makeWidget`. It will be **completely** removed in v1.0.');
});
it('should log a warning if add_widget is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid.add_widget(items[i]);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `add_widget` is deprecated as of v0.2.5 and has been replaced with `addWidget`. It will be **completely** removed in v1.0.');
});
it('should log a warning if set_animation is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid.set_animation(true);
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `set_animation` is deprecated as of v0.2.5 and has been replaced with `setAnimation`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _prepare_element is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
varitems=$('.grid-stack-item');
for(vari=0;i<items.length;i++){
grid._prepare_element(items[i]);
}
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_prepare_element` is deprecated as of v0.2.5 and has been replaced with `_prepareElement`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _is_one_column_mode is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._is_one_column_mode();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_is_one_column_mode` is deprecated as of v0.2.5 and has been replaced with `_isOneColumnMode`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _update_container_height is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._update_container_height();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_container_height` is deprecated as of v0.2.5 and has been replaced with `_updateContainerHeight`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _update_styles is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._update_styles();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_update_styles` is deprecated as of v0.2.5 and has been replaced with `_updateStyles`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _init_styles is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._init_styles();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_init_styles` is deprecated as of v0.2.5 and has been replaced with `_initStyles`. It will be **completely** removed in v1.0.');
});
it('should log a warning if _trigger_change_event is called.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
grid._trigger_change_event();
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Function `_trigger_change_event` is deprecated as of v0.2.5 and has been replaced with `_triggerChangeEvent`. It will be **completely** removed in v1.0.');
it('should log a warning if handle_class is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
handle_class:'grid-stack-header'
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `handle_class` is deprecated as of v0.2.5 and has been replaced with `handleClass`. It will be **completely** removed in v1.0.');
});
it('should log a warning if item_class is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
item_class:'grid-stack-item'
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `item_class` is deprecated as of v0.2.5 and has been replaced with `itemClass`. It will be **completely** removed in v1.0.');
});
it('should log a warning if placeholder_class is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
placeholder_class:'grid-stack-placeholder'
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `placeholder_class` is deprecated as of v0.2.5 and has been replaced with `placeholderClass`. It will be **completely** removed in v1.0.');
});
it('should log a warning if placeholder_text is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
placeholder_text:'placeholder'
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `placeholder_text` is deprecated as of v0.2.5 and has been replaced with `placeholderText`. It will be **completely** removed in v1.0.');
});
it('should log a warning if cell_height is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cell_height:80,
verticalMargin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `cell_height` is deprecated as of v0.2.5 and has been replaced with `cellHeight`. It will be **completely** removed in v1.0.');
});
it('should log a warning if vertical_margin is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
vertical_margin:10
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `vertical_margin` is deprecated as of v0.2.5 and has been replaced with `verticalMargin`. It will be **completely** removed in v1.0.');
});
it('should log a warning if min_width is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
min_width:2
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `min_width` is deprecated as of v0.2.5 and has been replaced with `minWidth`. It will be **completely** removed in v1.0.');
});
it('should log a warning if static_grid is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
static_grid:false
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `static_grid` is deprecated as of v0.2.5 and has been replaced with `staticGrid`. It will be **completely** removed in v1.0.');
});
it('should log a warning if is_nested is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
is_nested:false
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `is_nested` is deprecated as of v0.2.5 and has been replaced with `isNested`. It will be **completely** removed in v1.0.');
});
it('should log a warning if always_show_resize_handle is set.',function(){
console.warn=jasmine.createSpy('log');
varoptions={
cellHeight:80,
verticalMargin:10,
always_show_resize_handle:false
};
$('.grid-stack').gridstack(options);
vargrid=$('.grid-stack').data('gridstack');
expect(console.warn).toHaveBeenCalledWith('gridstack.js: Option `always_show_resize_handle` is deprecated as of v0.2.5 and has been replaced with `alwaysShowResizeHandle`. It will be **completely** removed in v1.0.');
});
});
describe('grid method _packNodes with float',function(){