MoveCanvasSpec.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import {
  2. bootstrapDiagram,
  3. inject
  4. } from 'test/TestHelper';
  5. import moveCanvasModule from 'lib/navigation/movecanvas';
  6. import interactionEventsModule from 'lib/features/interaction-events';
  7. describe('navigation/movecanvas', function() {
  8. describe('bootstrap', function() {
  9. beforeEach(bootstrapDiagram({ modules: [ moveCanvasModule ] }));
  10. it('should bootstrap', inject(function(moveCanvas, canvas) {
  11. canvas.addShape({
  12. id: 'test',
  13. width: 100,
  14. height: 100,
  15. x: 100,
  16. y: 100
  17. });
  18. expect(moveCanvas).not.to.be.null;
  19. }));
  20. });
  21. describe('integration', function() {
  22. beforeEach(bootstrapDiagram({ modules: [ moveCanvasModule, interactionEventsModule ] }));
  23. it('should silence click', inject(function(eventBus, moveCanvas, canvas) {
  24. canvas.addShape({
  25. id: 'test',
  26. width: 100,
  27. height: 100,
  28. x: 100,
  29. y: 100
  30. });
  31. // click should not be triggered on
  32. // canvas drag
  33. eventBus.on('element.click', function(e) {
  34. console.error('click', e);
  35. });
  36. }));
  37. });
  38. });