addNote test fix

This commit is contained in:
Milos Brzakovic
2021-08-11 19:27:37 +02:00
parent 5ff84a8efd
commit ee072772c2

View File

@@ -26,7 +26,7 @@ describe('iD.modeAddNote', function() {
});
describe('clicking the map', function () {
it('adds a note', function() {
it('adds a note', function(done) {
var note = iD.osmNote({
id: '-1',
comments: [],
@@ -35,9 +35,13 @@ describe('iD.modeAddNote', function() {
});
happen.mousedown(context.surface().node(), {});
happen.mouseup(window, {});
expect(iD.services.osm.caches().note.note[-1]).to.eql(note);
context.mode().exit();
d3.select('window').on('click.draw-block', null);
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