From b78a8d5d2a6eea70ed74daf03d429620984d7dae Mon Sep 17 00:00:00 2001 From: "Milos Brzakovic (E-Search)" Date: Thu, 21 Oct 2021 14:43:05 +0200 Subject: [PATCH] fix addNote test --- test/spec/modes/add_note.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/spec/modes/add_note.js b/test/spec/modes/add_note.js index def8159ae..519f37936 100644 --- a/test/spec/modes/add_note.js +++ b/test/spec/modes/add_note.js @@ -32,15 +32,19 @@ describe('iD.modeAddNote', function() { loc: [-77.02271, 38.90085], status: 'open' }); + + context.on('enter.addNoteTest', function(mode) { + if (mode.id === 'select-note') { + expect(iD.services.osm.caches().note.note[-1]).to.eql(note); + context.mode().exit(); + d3.select('window').on('click.draw-block', null); + context.on('enter.addNoteTest', null); + done(); + } + }); + happen.mousedown(context.surface().node(), {}); happen.mouseup(window, {}); - - window.setTimeout(function() { - expect(iD.services.osm.caches().note.note[-1]).to.eql(note); - context.mode().exit(); - d3.select('window').on('click.draw-block', null); - done(); - }, 50); }); // this won't work because draw behavior can only snap to entities, not notes