Skip to content
Snippets Groups Projects
Commit d509f58c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unit test added for updating from alias

parent 6beddb5e
No related branches found
No related tags found
1 merge request!177Small refactor
......@@ -61,70 +61,91 @@ describe('Alias', function () {
});
it("Alias update method", function () {
var javaObject = {
bounds: {
x: 190,
y: 44,
width: 80,
height: 40
},
modelId: 57,
idObject: 18554
};
var alias = new Alias(javaObject);
var javaObject2 = {
notes: "",
type: "Protein",
name: "s1",
synonyms: [],
formerSymbols: [],
references: [],
other: [],
bounds: {
x: 59,
y: 73,
width: 80,
height: 40
},
modelId: 54,
idObject: 18552
};
alias.update(javaObject2);
assert.ok(alias.isComplete());
assert.equal('s1', alias.name);
});
describe("update", function () {
describe("from json", function () {
it("full update", function () {
var javaObject = {
bounds: {
x: 190,
y: 44,
width: 80,
height: 40
},
modelId: 57,
idObject: 18554
};
var alias = new Alias(javaObject);
var javaObject2 = {
notes: "",
type: "Protein",
name: "s1",
synonyms: [],
formerSymbols: [],
references: [],
other: [],
bounds: {
x: 59,
y: 73,
width: 80,
height: 40
},
modelId: 54,
idObject: 18552
};
alias.update(javaObject2);
assert.ok(alias.isComplete());
assert.equal('s1', alias.getName());
});
it("partial update", function () {
var javaObject = {
bounds: {
x: 190,
y: 44,
width: 80,
height: 40
},
modelId: 57,
idObject: 18554
};
var alias = new Alias(javaObject);
var javaObject2 = {
notes: "",
type: "Protein",
synonyms: [],
formerSymbols: [],
references: [],
other: [],
bounds: {
x: 59,
y: 73,
width: 80,
height: 40
},
modelId: 54,
idObject: 18552
};
alias.update(javaObject2);
assert.equal(alias.isComplete(), false);
});
});
it("Alias update method 2", function () {
var javaObject = {
bounds: {
x: 190,
y: 44,
width: 80,
height: 40
},
modelId: 57,
idObject: 18554
};
var alias = new Alias(javaObject);
var javaObject2 = {
notes: "",
type: "Protein",
synonyms: [],
formerSymbols: [],
references: [],
other: [],
bounds: {
x: 59,
y: 73,
width: 80,
height: 40
},
modelId: 54,
idObject: 18552
};
alias.update(javaObject2);
assert.equal(alias.isComplete(), false);
it("from Alias", function () {
var javaObject = {
bounds: {
x: 190,
y: 44,
width: 80,
height: 40
},
modelId: 57,
idObject: 18554
};
var alias = new Alias(javaObject);
var alias2 = new Alias(javaObject);
alias.update(alias2);
assert.equal(alias.isComplete(), false);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment