diff --git a/test/index.html b/test/index.html index f17829653..3f2eba72e 100644 --- a/test/index.html +++ b/test/index.html @@ -137,7 +137,7 @@ iD.debug = true; mocha.setup({ ui: 'bdd', - globals: ['__onresize.tail-size'] + globals: ['__onresize.tail-size', '__onmousemove.zoom', '__onmouseup.zoom', '__onclick.draw'] }); var expect = chai.expect; diff --git a/test/spec/behavior/select.js b/test/spec/behavior/select.js index 42c568cca..e794cda8e 100644 --- a/test/spec/behavior/select.js +++ b/test/spec/behavior/select.js @@ -29,21 +29,31 @@ describe("iD.behavior.Select", function() { container.remove(); }); - specify("click on entity selects the entity", function() { - happen.click(context.surface().select('.' + a.id).node()); - expect(context.selection()).to.eql([a.id]); + specify("click on entity selects the entity", function(done) { + happen.mousedown(context.surface().select('.' + a.id).node()); + window.setTimeout(function() { + expect(context.selection()).to.eql([a.id]); + done(); + }, 600); }); - specify("click on empty space clears the selection", function() { + specify("click on empty space clears the selection", function(done) { context.enter(iD.modes.Select(context, [a.id])); happen.click(context.surface().node()); - expect(context.selection()).to.eql([]); + happen.mousedown(context.surface().node()); + window.setTimeout(function() { + expect(context.selection()).to.eql([]); + done(); + }, 600); }); - specify("shift-click on entity adds the entity to the selection", function() { + specify("shift-click on entity adds the entity to the selection", function(done) { context.enter(iD.modes.Select(context, [a.id])); - happen.click(context.surface().select('.' + b.id).node(), {shiftKey: true}); - expect(context.selection()).to.eql([a.id, b.id]); + happen.mousedown(context.surface().select('.' + b.id).node(), {shiftKey: true}); + window.setTimeout(function() { + expect(context.selection()).to.eql([a.id, b.id]); + done(); + }, 600); }); specify("shift-click on empty space leaves the selection unchanged", function() { diff --git a/test/spec/modes/add_point.js b/test/spec/modes/add_point.js index 62291f8ee..5807a3c0b 100644 --- a/test/spec/modes/add_point.js +++ b/test/spec/modes/add_point.js @@ -17,13 +17,13 @@ describe("iD.modes.AddPoint", function() { describe("clicking the map", function () { it("adds a node", function() { happen.mousedown(context.surface().node(), {}); - happen.mouseup(window, {}); + happen.click(window, {}); expect(context.changes().created).to.have.length(1); }); it("selects the node", function() { happen.mousedown(context.surface().node(), {}); - happen.mouseup(window, {}); + happen.click(window, {}); expect(context.mode().id).to.equal('select'); expect(context.mode().selection()).to.eql([context.changes().created[0].id]); });