Merge branch 'master' into dynamic-layers

This commit is contained in:
Tom MacWright
2013-02-05 12:10:54 -05:00
4 changed files with 31 additions and 8 deletions

View File

@@ -1,12 +1,17 @@
describe("iD.ui.confirm", function () {
var elem;
beforeEach(function() { elem = d3.select('body').append('div'); });
afterEach(function() { elem.remove(); });
it('can be instantiated', function () {
var confirm = iD.ui.confirm();
var confirm = iD.ui.confirm(elem);
expect(confirm).to.be.ok;
happen.keydown(document, {keyCode: 27}); // dismiss
});
it('can be dismissed', function () {
var confirm = iD.ui.confirm();
var confirm = iD.ui.confirm(elem);
happen.click(confirm.select('button').node());
expect(confirm.node().parentNode).to.be.null;
happen.keydown(document, {keyCode: 27}); // dismiss

View File

@@ -1,6 +1,14 @@
describe("iD.ui.flash", function () {
var clock;
var elem;
beforeEach(function() {
elem = d3.select('body').append('div');
});
afterEach(function() { elem.remove(); });
beforeEach(function () {
clock = sinon.useFakeTimers();
});
@@ -10,7 +18,7 @@ describe("iD.ui.flash", function () {
});
it('leaves after 1000 ms', function () {
var flash = iD.ui.flash();
var flash = iD.ui.flash(elem);
clock.tick(1610);
expect(flash.node().parentNode).to.be.null;
});

View File

@@ -1,10 +1,10 @@
describe("iD.ui.inspector", function () {
var inspector, element,
tags = {highway: 'residential'},
entity, graph;
entity, graph, context;
function render() {
inspector = iD.ui.inspector().graph(graph);
inspector = iD.ui.inspector().context(context);
element = d3.select('body')
.append('div')
.attr('id', 'inspector-wrap')
@@ -14,7 +14,7 @@ describe("iD.ui.inspector", function () {
beforeEach(function () {
entity = iD.Entity({type: 'node', id: "n12345", tags: tags});
graph = iD.Graph([entity]);
context = iD();
render();
});

View File

@@ -1,6 +1,16 @@
describe("iD.ui.modal", function () {
it('can be instantiated', function () {
var modal = iD.ui.modal()
var elem;
beforeEach(function() {
elem = d3.select('body').append('div');
});
afterEach(function() {
elem.remove();
});
it('can be instantiated', function() {
var modal = iD.ui.modal(elem)
.select('.content')
.text('foo');
expect(modal).to.be.ok;