mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Don't remove all the divs under body when testing
This commit is contained in:
@@ -2,11 +2,14 @@ describe('iD.uiConfirm', function () {
|
||||
var elem;
|
||||
|
||||
beforeEach(function() {
|
||||
elem = d3.select('body').append('div');
|
||||
elem = d3.select('body')
|
||||
.append('div')
|
||||
.attr('id', 'confirm-wrap');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
elem.remove();
|
||||
d3.select('#confirm-wrap')
|
||||
.remove();
|
||||
});
|
||||
|
||||
it('can be instantiated', function () {
|
||||
|
||||
@@ -9,7 +9,8 @@ describe('iD.uiFlash', function () {
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
d3.select('body > div').remove();
|
||||
d3.select('#flash-wrap')
|
||||
.remove();
|
||||
});
|
||||
|
||||
it('returns a selection', function () {
|
||||
|
||||
@@ -2,11 +2,14 @@ describe('iD.uiModal', function () {
|
||||
var elem;
|
||||
|
||||
beforeEach(function() {
|
||||
elem = d3.select('body').append('div');
|
||||
elem = d3.select('body')
|
||||
.append('div')
|
||||
.attr('id', 'modal-wrap');
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
elem.remove();
|
||||
d3.select('#modal-wrap')
|
||||
.remove();
|
||||
});
|
||||
|
||||
it('can be instantiated', function() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
describe('iD.uiRawTagEditor', function() {
|
||||
var taglist, element,
|
||||
entity, context;
|
||||
var taglist, element, entity, context;
|
||||
|
||||
function render(tags) {
|
||||
taglist = iD.uiRawTagEditor(context)
|
||||
@@ -10,6 +9,7 @@ describe('iD.uiRawTagEditor', function() {
|
||||
|
||||
element = d3.select('body')
|
||||
.append('div')
|
||||
.attr('class', 'ui-wrap')
|
||||
.call(taglist);
|
||||
}
|
||||
|
||||
@@ -21,9 +21,11 @@ describe('iD.uiRawTagEditor', function() {
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
element.remove();
|
||||
d3.selectAll('.ui-wrap')
|
||||
.remove();
|
||||
});
|
||||
|
||||
|
||||
it('creates input elements for each key-value pair', function () {
|
||||
expect(element.selectAll('input[value=highway]')).not.to.be.empty;
|
||||
expect(element.selectAll('input[value=residential]')).not.to.be.empty;
|
||||
|
||||
Reference in New Issue
Block a user