441849b51ae0871b494cfc2f24f53ad3a06754ac3c3a5e8e8f707ab93e7a4125048e480bf72bedb2882d26a93f71e5f9a0eb586fc30f33e140c8775045f891 734 B

1234567891011121314151617181920212223242526272829
  1. describe('Core.spliceCellsMeta', () => {
  2. var id = 'testContainer';
  3. beforeEach(function() {
  4. this.$container = $(`<div id="${id}"></div>`).appendTo('body');
  5. });
  6. afterEach(function() {
  7. if (this.$container) {
  8. destroy();
  9. this.$container.remove();
  10. }
  11. });
  12. it('should splice the cell meta array analogously to the native `splice` method', () => {
  13. handsontable();
  14. var allMeta = getCellsMeta();
  15. expect(allMeta.length).toBe(25);
  16. spliceCellsMeta(3, 1);
  17. allMeta = getCellsMeta();
  18. expect(allMeta.length).toBe(20);
  19. var metaAtRow = getCellMetaAtRow(2);
  20. expect(metaAtRow[0].row).toEqual(2);
  21. metaAtRow = getCellMetaAtRow(3);
  22. expect(metaAtRow[0].row).toEqual(4);
  23. });
  24. });