mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-30 03:39:36 +02:00
Fix tests
This commit is contained in:
@@ -38,12 +38,17 @@ describe('iD.Node', function () {
|
||||
});
|
||||
|
||||
describe("#geometry", function () {
|
||||
it("returns 'vertex' if the node is not a point", function () {
|
||||
expect(iD.Node().geometry()).to.equal('vertex');
|
||||
it("returns 'vertex' if the node is a member of any way", function () {
|
||||
var node = iD.Node(),
|
||||
way = iD.Way({nodes: [node.id]}),
|
||||
graph = iD.Graph([node, way]);
|
||||
expect(node.geometry(graph)).to.equal('vertex');
|
||||
});
|
||||
|
||||
it("returns 'point' if the node is a point", function () {
|
||||
expect(iD.Node({_poi: true}).geometry()).to.equal('point');
|
||||
it("returns 'point' if the node is not a member of any way", function () {
|
||||
var node = iD.Node(),
|
||||
graph = iD.Graph([node]);
|
||||
expect(node.geometry(graph)).to.equal('point');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,8 +3,8 @@ describe("iD.modes.AddPoint", function () {
|
||||
|
||||
beforeEach(function () {
|
||||
container = d3.select('body').append('div');
|
||||
map = iD.Map();
|
||||
history = iD.History();
|
||||
map = iD.Map().history(history);
|
||||
controller = iD.Controller(map, history);
|
||||
|
||||
container.call(map);
|
||||
|
||||
@@ -10,7 +10,8 @@ describe("iD.svg.Vertices", function () {
|
||||
|
||||
it("adds tag classes", function () {
|
||||
var node = iD.Node({tags: {highway: "traffic_signals"}, loc: [0, 0]}),
|
||||
graph = iD.Graph([node]);
|
||||
way = iD.Way({nodes: [node.id]}),
|
||||
graph = iD.Graph([node, way]);
|
||||
|
||||
surface.call(iD.svg.Vertices(projection), graph, [node], filter);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
describe("iD.ui.inspector", function () {
|
||||
var inspector, element,
|
||||
tags = {highway: 'residential'},
|
||||
entity;
|
||||
entity, graph;
|
||||
|
||||
function render() {
|
||||
inspector = iD.ui.inspector();
|
||||
inspector = iD.ui.inspector().graph(graph);
|
||||
element = d3.select('body')
|
||||
.append('div')
|
||||
.attr('id', 'inspector-wrap')
|
||||
@@ -14,6 +14,7 @@ describe("iD.ui.inspector", function () {
|
||||
|
||||
beforeEach(function () {
|
||||
entity = iD.Entity({type: 'node', id: "n12345", tags: tags});
|
||||
graph = iD.Graph([entity]);
|
||||
render();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user