Move more inspector logic to Inspector

This commit is contained in:
John Firebaugh
2013-03-17 20:07:44 -07:00
parent 13b5cc4c4d
commit fdcb96e8d6
3 changed files with 48 additions and 87 deletions
-35
View File
@@ -1,37 +1,2 @@
describe("iD.ui.Inspector", function () {
var inspector, element,
tags = {highway: 'residential'},
entity, context;
beforeEach(function () {
entity = iD.Entity({type: 'node', id: "n12345", tags: tags});
context = iD();
inspector = iD.ui.Inspector(context, entity);
element = d3.select('body')
.append('div')
.attr('id', 'inspector-wrap')
.call(inspector);
});
afterEach(function () {
element.remove();
});
it("emits a close event when the apply button is clicked", function () {
var spy = sinon.spy();
inspector.on('close', spy);
element.select('.apply').trigger('click');
expect(spy).to.have.been.calledWith(entity);
});
xit("emits a changeTags event when the apply button is clicked", function () {
var spy = sinon.spy();
inspector.on('changeTags', spy);
element.select('.apply').trigger('click');
expect(spy).to.have.been.calledWith(entity, tags);
});
});