mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Fix tests
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
<script src="lib/sinon-chai.js"></script>
|
||||
<script src="lib/bind-shim.js"></script>
|
||||
<script src="lib/happen.js"></script>
|
||||
<script src="lib/rtree.js"></script>
|
||||
|
||||
<!-- include source files here... -->
|
||||
<script src='../js/lib/lodash.js'></script>
|
||||
@@ -29,6 +28,7 @@
|
||||
<script src='../js/lib/d3.tail.js'></script>
|
||||
<script src='../js/lib/ohauth.js'></script>
|
||||
<script src='../js/lib/jxon.js'></script>
|
||||
<script src="../js/lib/rtree.js"></script>
|
||||
|
||||
<script src='../js/id/id.js'></script>
|
||||
<script src='../js/id/util.js'></script>
|
||||
|
||||
@@ -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