htmlRenderer.spec.js 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. describe('HTMLRenderer', () => {
  2. var id = 'testContainer';
  3. beforeEach(function() {
  4. this.$container = $(`<div id="${id}" style="width: 300px; height: 200px;"></div>`).appendTo('body');
  5. });
  6. afterEach(function() {
  7. if (this.$container) {
  8. destroy();
  9. this.$container.remove();
  10. }
  11. });
  12. it('should not fill empty rows with null values', () => {
  13. handsontable({
  14. data: [['a', 'b', 'c', 'd', 'e', 'f']],
  15. colHeaders: true,
  16. rowHeaders: true,
  17. minSpareRows: 5,
  18. renderer: 'html'
  19. });
  20. expect($('.handsontable table tr:last-child td:eq(0)').html()).toEqual('');
  21. expect($('.handsontable table tr:last-child td:eq(1)').html()).toEqual('');
  22. expect($('.handsontable table tr:last-child td:eq(2)').html()).toEqual('');
  23. expect($('.handsontable table tr:last-child td:eq(3)').html()).toEqual('');
  24. expect($('.handsontable table tr:last-child td:eq(4)').html()).toEqual('');
  25. expect($('.handsontable table tr:last-child td:eq(5)').html()).toEqual('');
  26. });
  27. });