manualRowMoveUI.e2e.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. describe('manualRowMove', function () {
  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('UI', function () {
  13. it('should append UI elements to wtHider after click on row header', function () {
  14. var hot = handsontable({
  15. data: Handsontable.helper.createSpreadsheetData(30, 30),
  16. rowHeaders: true,
  17. manualRowMove: true
  18. });
  19. var $headerTH = this.$container.find('tbody tr:eq(0) th:eq(0)');
  20. $headerTH.simulate('mousedown');
  21. $headerTH.simulate('mouseup');
  22. $headerTH.simulate('mousedown');
  23. expect(this.$container.find('.ht__manualRowMove--guideline').length).toBe(1);
  24. expect(this.$container.find('.ht__manualRowMove--backlight').length).toBe(1);
  25. });
  26. it('should part of UI elements be visible on dragging action', function () {
  27. var hot = handsontable({
  28. data: Handsontable.helper.createSpreadsheetData(30, 30),
  29. rowHeaders: true,
  30. manualRowMove: true
  31. });
  32. var $headerTH = this.$container.find('tbody tr:eq(0) th:eq(0)');
  33. $headerTH.simulate('mousedown');
  34. $headerTH.simulate('mouseup');
  35. $headerTH.simulate('mousedown');
  36. expect(this.$container.find('.ht__manualRowMove--guideline:visible').length).toBe(0);
  37. expect(this.$container.find('.ht__manualRowMove--backlight:visible').length).toBe(1);
  38. });
  39. it('should all of UI elements be visible on dragging action', function () {
  40. var hot = handsontable({
  41. data: Handsontable.helper.createSpreadsheetData(30, 30),
  42. rowHeaders: true,
  43. manualRowMove: true
  44. });
  45. var $headers = [this.$container.find('tbody tr:eq(0) th:eq(0)'), this.$container.find('tbody tr:eq(1) th:eq(0)'), this.$container.find('tbody tr:eq(2) th:eq(0)')];
  46. $headers[0].simulate('mousedown');
  47. $headers[0].simulate('mouseup');
  48. $headers[0].simulate('mousedown');
  49. $headers[1].simulate('mouseover');
  50. $headers[2].simulate('mouseover');
  51. expect(this.$container.find('.ht__manualRowMove--guideline:visible').length).toBe(1);
  52. expect(this.$container.find('.ht__manualRowMove--backlight:visible').length).toBe(1);
  53. });
  54. });
  55. });