mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(gesture): fix gesture directive tests
This commit is contained in:
10
js/angular/directive/gesture.js
vendored
10
js/angular/directive/gesture.js
vendored
@@ -1,10 +1,8 @@
|
||||
var GESTURE_DIRECTIVES = 'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' ');
|
||||
|
||||
forEach(
|
||||
'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft'.split(' '),
|
||||
function(name) {
|
||||
IonicModule.directive(name, gestureDirective(name));
|
||||
}
|
||||
);
|
||||
GESTURE_DIRECTIVES.forEach(function(name) {
|
||||
IonicModule.directive(name, gestureDirective(name));
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
describe('gesture directive', function() {
|
||||
beforeEach(module('ionic'));
|
||||
|
||||
'onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeBottom onSwipeLeft'
|
||||
.split(' ')
|
||||
GESTURE_DIRECTIVES
|
||||
.map(function(directiveName) {
|
||||
return {
|
||||
gestureName: directiveName.substr(2).toLowerCase(),
|
||||
@@ -12,8 +11,8 @@ describe('gesture directive', function() {
|
||||
})
|
||||
};
|
||||
})
|
||||
.forEach(function(directive){
|
||||
it('should compile', inject(function($compile, $rootScope, $ionicGesture) {
|
||||
.forEach(function(directive){
|
||||
iit('should compile', inject(function($compile, $rootScope, $ionicGesture) {
|
||||
var fakeGesture = {};
|
||||
spyOn($ionicGesture, 'on').andCallFake(function(eventType, listener, el) {
|
||||
callback = listener;
|
||||
@@ -24,7 +23,7 @@ describe('gesture directive', function() {
|
||||
$rootScope.$apply();
|
||||
|
||||
el.scope().foo = jasmine.createSpy('foo');
|
||||
|
||||
|
||||
expect($ionicGesture.on.mostRecentCall.args[0]).toBe(directive.gestureName);
|
||||
var event = {};
|
||||
callback(event);
|
||||
|
||||
Reference in New Issue
Block a user