mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Fix tests for faux click
This commit is contained in:
@@ -3,7 +3,7 @@ iD.behavior.Draw = function(context) {
|
||||
'clickNode', 'undo', 'cancel', 'finish'),
|
||||
keybinding = d3.keybinding('draw'),
|
||||
hover = iD.behavior.Hover(),
|
||||
closeTolerance = 4;
|
||||
closeTolerance = 4,
|
||||
tolerance = 12;
|
||||
|
||||
function datum() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
describe("iD.modes.AddPoint", function () {
|
||||
describe("iD.modes.AddPoint", function() {
|
||||
var context;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(function() {
|
||||
var container = d3.select(document.createElement('div'));
|
||||
|
||||
context = iD()
|
||||
@@ -15,20 +15,22 @@ describe("iD.modes.AddPoint", function () {
|
||||
});
|
||||
|
||||
describe("clicking the map", function () {
|
||||
it("adds a node", function () {
|
||||
happen.click(context.surface().node(), {});
|
||||
it("adds a node", function() {
|
||||
happen.mousedown(context.surface().node(), {});
|
||||
happen.mouseup(window, {});
|
||||
expect(context.changes().created).to.have.length(1);
|
||||
});
|
||||
|
||||
it("selects the node", function () {
|
||||
happen.click(context.surface().node(), {});
|
||||
it("selects the node", function() {
|
||||
happen.mousedown(context.surface().node(), {});
|
||||
happen.mouseup(window, {});
|
||||
expect(context.mode().id).to.equal('select');
|
||||
expect(context.mode().selection()).to.eql([context.changes().created[0].id]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("pressing ⎋", function () {
|
||||
it("exits to browse mode", function () {
|
||||
describe("pressing ⎋", function() {
|
||||
it("exits to browse mode", function() {
|
||||
happen.keydown(document, {keyCode: 27});
|
||||
expect(context.mode().id).to.equal('browse');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user