2105ce868911966f9644b046754be4527c750581f66a5630c361d9131489018c4a74a084b96889a7453b1da978fc623ecbcfb055d2c5e7e8c4ea21559289ef 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. describe('Core.isEmpty*', () => {
  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. describe('isEmptyRow', () => {
  13. it('should be empty row', () => {
  14. handsontable();
  15. var hot = getInstance();
  16. expect(hot.isEmptyRow(0)).toEqual(true);
  17. });
  18. it('should not be empty row', () => {
  19. handsontable();
  20. setDataAtCell(0, 0, 'test');
  21. var hot = getInstance();
  22. expect(hot.isEmptyRow(0)).toEqual(false);
  23. });
  24. it('should bind this to instance', () => {
  25. handsontable();
  26. var hot = getInstance();
  27. var check = hot.isEmptyRow;
  28. expect(check(0)).toEqual(true); // this may be change in future when we switch to define isEmptyCol in prototype
  29. });
  30. });
  31. describe('isEmptyCol', () => {
  32. it('should be empty row', () => {
  33. handsontable();
  34. var hot = getInstance();
  35. expect(hot.isEmptyCol(0)).toEqual(true);
  36. });
  37. it('should not be empty row', () => {
  38. handsontable();
  39. setDataAtCell(0, 0, 'test');
  40. var hot = getInstance();
  41. expect(hot.isEmptyCol(0)).toEqual(false);
  42. });
  43. it('should bind this to instance', () => {
  44. handsontable();
  45. var hot = getInstance();
  46. var check = hot.isEmptyCol;
  47. expect(check(0)).toEqual(true); // this may be change in future when we switch to define isEmptyCol in prototype
  48. });
  49. });
  50. });