mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Add freezing specs
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
describe('Entity', function () {
|
||||
if (iD.debug) {
|
||||
it("is frozen", function () {
|
||||
expect(Object.isFrozen(iD.Entity())).to.be.true;
|
||||
});
|
||||
|
||||
it("freezes tags", function () {
|
||||
expect(Object.isFrozen(iD.Entity().tags)).to.be.true;
|
||||
});
|
||||
|
||||
it("does not freeze transients", function () {
|
||||
expect(Object.isFrozen(iD.Entity().transients)).to.be.false;
|
||||
});
|
||||
}
|
||||
|
||||
describe("#update", function () {
|
||||
it("returns a new Entity", function () {
|
||||
var a = iD.Entity(),
|
||||
@@ -125,6 +139,12 @@ describe('Node', function () {
|
||||
});
|
||||
|
||||
describe('Way', function () {
|
||||
if (iD.debug) {
|
||||
it("freezes nodes", function () {
|
||||
expect(Object.isFrozen(iD.Way().nodes)).to.be.true;
|
||||
});
|
||||
}
|
||||
|
||||
it("returns a way", function () {
|
||||
expect(iD.Way().type).to.equal("way");
|
||||
});
|
||||
@@ -172,6 +192,12 @@ describe('Way', function () {
|
||||
});
|
||||
|
||||
describe('Relation', function () {
|
||||
if (iD.debug) {
|
||||
it("freezes nodes", function () {
|
||||
expect(Object.isFrozen(iD.Relation().members)).to.be.true;
|
||||
});
|
||||
}
|
||||
|
||||
it("returns a relation", function () {
|
||||
expect(iD.Relation().type).to.equal("relation");
|
||||
});
|
||||
|
||||
@@ -16,6 +16,16 @@ describe('iD.Graph', function() {
|
||||
expect(graph.annotation).to.equal('first graph');
|
||||
});
|
||||
|
||||
if (iD.debug) {
|
||||
it("is frozen", function () {
|
||||
expect(Object.isFrozen(iD.Graph())).to.be.true;
|
||||
});
|
||||
|
||||
it("freezes entities", function () {
|
||||
expect(Object.isFrozen(iD.Graph().entities)).to.be.true;
|
||||
});
|
||||
}
|
||||
|
||||
describe('operations', function() {
|
||||
it('#remove', function() {
|
||||
var entities = { 'n-1': {
|
||||
|
||||
Reference in New Issue
Block a user