Check sooner and only assert if duration hasn't passed
This commit is contained in:
@@ -211,14 +211,16 @@ describe('ol.Map', function() {
|
|||||||
|
|
||||||
// confirm that the center is somewhere between origin and destination
|
// confirm that the center is somewhere between origin and destination
|
||||||
// after a short delay
|
// after a short delay
|
||||||
waits(100);
|
waits(goog.async.AnimationDelay.TIMEOUT);
|
||||||
runs(function() {
|
runs(function() {
|
||||||
expect(o.callback).toHaveBeenCalled();
|
expect(o.callback).toHaveBeenCalled();
|
||||||
var loc = map.getView().getCenter();
|
var loc = map.getView().getCenter();
|
||||||
expect(loc.x).not.toEqual(origin.x);
|
expect(loc.x).not.toEqual(origin.x);
|
||||||
expect(loc.y).not.toEqual(origin.y);
|
expect(loc.y).not.toEqual(origin.y);
|
||||||
expect(loc.x).not.toEqual(destination.x);
|
if (new Date().getTime() - start < duration) {
|
||||||
expect(loc.y).not.toEqual(destination.y);
|
expect(loc.x).not.toEqual(destination.x);
|
||||||
|
expect(loc.y).not.toEqual(destination.y);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// confirm that the map has reached the destination after the duration
|
// confirm that the map has reached the destination after the duration
|
||||||
|
|||||||
Reference in New Issue
Block a user