test_swipe.js 539 B

1234567891011121314151617181920212223242526272829
  1. var el,
  2. hammer,
  3. swipeCount = 0;
  4. module('Swipe Gesture', {
  5. setup: function() {
  6. el = utils.createHitArea();
  7. hammer = new Hammer(el, {recognizers: []});
  8. swipeCount = 0;
  9. },
  10. teardown: function() {
  11. hammer.destroy();
  12. }
  13. });
  14. test('swipe can be recognized', function() {
  15. expect(1);
  16. var swipe = new Hammer.Swipe({threshold: 1});
  17. hammer.add(swipe);
  18. hammer.on('swipe', function() {
  19. ok(true);
  20. start();
  21. });
  22. stop();
  23. Simulator.gestures.swipe(el);
  24. });