Remove unused

This commit is contained in:
John Firebaugh
2013-02-02 19:55:52 -05:00
parent ec602a7db7
commit 80a5a083b0
5 changed files with 1 additions and 79 deletions

View File

@@ -43,7 +43,6 @@ iD.Entity.prototype = {
if (!this.id && this.type) {
this.id = iD.Entity.id(this.type);
this._updated = true;
}
if (iD.debug) {
@@ -63,7 +62,7 @@ iD.Entity.prototype = {
},
update: function(attrs) {
return iD.Entity(this, attrs, {_updated: true});
return iD.Entity(this, attrs);
},
mergeTags: function(tags) {
@@ -80,14 +79,6 @@ iD.Entity.prototype = {
return this.update({tags: merged});
},
created: function() {
return this._updated && this.osmId().charAt(0) === '-';
},
modified: function() {
return this._updated && this.osmId().charAt(0) !== '-';
},
intersects: function(extent, resolver) {
return this.extent(resolver).intersects(extent);
},

View File

@@ -52,12 +52,6 @@ describe('iD.Entity', function () {
expect(e.id).to.equal('w1');
});
it("tags the entity as updated", function () {
var tags = {foo: 'bar'},
e = iD.Entity().update({tags: tags});
expect(e._updated).to.to.be.true;
});
it("doesn't modify the input", function () {
var attrs = {tags: {foo: 'bar'}},
e = iD.Entity().update(attrs);
@@ -104,42 +98,6 @@ describe('iD.Entity', function () {
});
});
describe("#created", function () {
it("returns falsy by default", function () {
expect(iD.Entity({id: 'w1234'}).created()).not.to.be.ok;
});
it("returns falsy for an unmodified Entity", function () {
expect(iD.Entity({id: 'w1234'}).created()).not.to.be.ok;
});
it("returns falsy for a modified Entity with positive ID", function () {
expect(iD.Entity({id: 'w1234'}).update({}).created()).not.to.be.ok;
});
it("returns truthy for a modified Entity with negative ID", function () {
expect(iD.Entity({id: 'w-1234'}).update({}).created()).to.be.ok;
});
});
describe("#modified", function () {
it("returns falsy by default", function () {
expect(iD.Entity({id: 'w1234'}).modified()).not.to.be.ok;
});
it("returns falsy for an unmodified Entity", function () {
expect(iD.Entity({id: 'w1234'}).modified()).not.to.be.ok;
});
it("returns truthy for a modified Entity with positive ID", function () {
expect(iD.Entity({id: 'w1234'}).update({}).modified()).to.be.ok;
});
it("returns falsy for a modified Entity with negative ID", function () {
expect(iD.Entity({id: 'w-1234'}).update({}).modified()).not.to.be.ok;
});
});
describe("#intersects", function () {
it("returns true for a way with a node within the given extent", function () {
var node = iD.Node({loc: [0, 0]}),

View File

@@ -4,15 +4,6 @@ describe('iD.Node', function () {
expect(iD.Node().type).to.equal("node");
});
it("returns a created Entity if no ID is specified", function () {
expect(iD.Node().created()).to.be.ok;
});
it("returns an unmodified Entity if ID is specified", function () {
expect(iD.Node({id: 'n1234'}).created()).not.to.be.ok;
expect(iD.Node({id: 'n1234'}).modified()).not.to.be.ok;
});
it("defaults tags to an empty object", function () {
expect(iD.Node().tags).to.eql({});
});

View File

@@ -10,15 +10,6 @@ describe('iD.Relation', function () {
expect(iD.Relation().type).to.equal("relation");
});
it("returns a created Entity if no ID is specified", function () {
expect(iD.Relation().created()).to.be.ok;
});
it("returns an unmodified Entity if ID is specified", function () {
expect(iD.Relation({id: 'r1234'}).created()).not.to.be.ok;
expect(iD.Relation({id: 'r1234'}).modified()).not.to.be.ok;
});
it("defaults members to an empty array", function () {
expect(iD.Relation().members).to.eql([]);
});

View File

@@ -10,15 +10,6 @@ describe('iD.Way', function() {
expect(iD.Way().type).to.equal("way");
});
it("returns a created Entity if no ID is specified", function () {
expect(iD.Way().created()).to.be.ok;
});
it("returns an unmodified Entity if ID is specified", function () {
expect(iD.Way({id: 'w1234'}).created()).not.to.be.ok;
expect(iD.Way({id: 'w1234'}).modified()).not.to.be.ok;
});
it("defaults nodes to an empty array", function () {
expect(iD.Way().nodes).to.eql([]);
});