diff --git a/test/spec/renderer/map.js b/test/spec/renderer/map.js index 84f4e5411..fba86bd4c 100644 --- a/test/spec/renderer/map.js +++ b/test/spec/renderer/map.js @@ -43,9 +43,10 @@ describe('iD.Map', function() { expect(map.zoom(4)).to.equal(map); map.zoomIn(); window.setTimeout(function() { + d3.timerFlush(); expect(map.zoom()).to.be.closeTo(5, 1e-6); done(); - }, 300); + }, 275); }); }); @@ -54,9 +55,10 @@ describe('iD.Map', function() { expect(map.zoom(4)).to.equal(map); map.zoomOut(); window.setTimeout(function() { + d3.timerFlush(); expect(map.zoom()).to.be.closeTo(3, 1e-6); done(); - }, 300); + }, 275); }); }); @@ -95,12 +97,13 @@ describe('iD.Map', function() { describe('#centerEase', function() { it('sets center', function(done) { expect(map.center([10, 10])).to.equal(map); - expect(map.centerEase([20, 20])).to.equal(map); + expect(map.centerEase([20, 20], 250)).to.equal(map); window.setTimeout(function() { + d3.timerFlush(); expect(map.center()[0]).to.be.closeTo(20, 1e-6); expect(map.center()[1]).to.be.closeTo(20, 1e-6); done(); - }, 1000); + }, 275); }); }); diff --git a/test/spec/ui/flash.js b/test/spec/ui/flash.js index ce5916d57..08174d66a 100644 --- a/test/spec/ui/flash.js +++ b/test/spec/ui/flash.js @@ -8,7 +8,7 @@ describe('iD.uiFlash', function () { .attr('id', 'footer-wrap'); }); - afterEach(function () { + afterEach(function() { d3.select('body > div').remove(); }); @@ -18,7 +18,7 @@ describe('iD.uiFlash', function () { expect(content.classed('content')).to.be.ok; }); - it('flash is shown', function () { + it('flash is shown', function() { iD.uiFlash(200); var flashWrap = d3.selectAll('#flash-wrap'); var footerWrap = d3.selectAll('#footer-wrap'); @@ -26,15 +26,16 @@ describe('iD.uiFlash', function () { expect(footerWrap.classed('footer-hide')).to.be.ok; }); - it('flash goes away', function (done) { + it('flash goes away', function(done) { iD.uiFlash(200); window.setTimeout(function() { + d3.timerFlush(); var flashWrap = d3.selectAll('#flash-wrap'); var footerWrap = d3.selectAll('#footer-wrap'); expect(flashWrap.classed('footer-hide')).to.be.ok; expect(footerWrap.classed('footer-show')).to.be.ok; done(); - }, 500); + }, 225); }); });