propToCol.spec.js 625 B

1234567891011121314151617181920212223242526
  1. describe('Core.propToCol', () => {
  2. const 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 return valid index for newly added column when manualColumnMove is enabled', () => {
  13. const hot = handsontable({
  14. data: Handsontable.helper.createSpreadsheetData(10, 10),
  15. manualColumnMove: true,
  16. });
  17. hot.alter('insert_col', 5);
  18. expect(propToCol(0)).toBe(0);
  19. expect(propToCol(10)).toBe(10);
  20. });
  21. });