Files
iD/test/spec/format/geojson.js
T
John Firebaugh 5ea855e18d Replace Graph#fetch with Graph#childNodes
Having two kinds of Ways (fetched and non-fetched)
introduced some accidental complexity. This brings things
more in line with how parentWays/parentRelations work.

Fixes #73.
2013-01-25 15:10:44 -05:00

18 lines
630 B
JavaScript

describe('iD.format.GeoJSON', function() {
describe('#mapping', function() {
it('converts a node to GeoJSON', function() {
var node = iD.Node({loc: [-77, 38]}),
graph = iD.Graph([node]);
expect(iD.format.GeoJSON.mapping(node, graph).geometry.type).to.equal('Point');
});
it('converts a way to GeoJSON', function() {
var way = iD.Way(),
graph = iD.Graph([way]),
json = iD.format.GeoJSON.mapping(way, graph);
expect(json.type).to.equal('Feature');
expect(json.geometry.type).to.equal('LineString');
});
});
});