Be more specific in tests about which form we are interested in

This commit is contained in:
Tom MacWright
2013-01-31 15:24:45 -05:00
parent ecb27eaf2f
commit 681bf7c724
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ iD.ui.inspector = function() {
inspectorwrap.append('h4')
.text(t('edit_tags'));
tagList = inspectorwrap.append('ul');
tagList = inspectorwrap.append('ul')
.attr('class', 'tag-list');
var newTag = inspectorwrap.append('button')
.attr('class', 'add-tag');
+4 -4
View File
@@ -43,14 +43,14 @@ describe("iD.ui.inspector", function () {
element.remove();
entity = entity.update({tags: {}});
render();
expect(element.selectAll("input.value").property('value')).to.be.empty;
expect(element.selectAll("input.key").property('value')).to.be.empty;
expect(element.select('.tag-list').selectAll("input.value").property('value')).to.be.empty;
expect(element.select('.tag-list').selectAll("input.key").property('value')).to.be.empty;
});
it("adds tags when clicking the add button", function () {
element.selectAll("button.add-tag").trigger('click');
expect(element.selectAll("input")[0][2].value).to.be.empty;
expect(element.selectAll("input")[0][3].value).to.be.empty;
expect(element.select('.tag-list').selectAll("input")[0][2].value).to.be.empty;
expect(element.select('.tag-list').selectAll("input")[0][3].value).to.be.empty;
});
it("removes tags when clicking the remove button", function () {