fix drag handler tests

This commit is contained in:
Éric Lemoine
2012-07-13 16:20:07 +02:00
parent 1f62bd8cd6
commit 6fd5bb8647

View File

@@ -60,14 +60,12 @@ describe('ol.handler.Drag', function() {
expect(listener.fn.calls[1].args[0].deltaY).toBe(2);
});
it('calls the default action on the default control', function() {
var control = new ol.control.DefaultControl();
spyOn(control, 'defaultDrag');
map.setDefaultControl(control);
it('calls the default action', function() {
var handler = new ol.handler.Drag(map, {});
spyOn(handler, 'defaultDrag');
handler.dragger_.dispatchEvent({type: 'drag'});
expect(control.defaultDrag).toHaveBeenCalled();
expect(handler.defaultDrag).toHaveBeenCalled();
});
});
});