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

Merge branch 'small-refactor' into 'master'

Small refactor

See merge request piotr.gawron/minerva!177
parents 40ffece9 2fcc7278
No related branches found
No related tags found
1 merge request!177Small refactor
Pipeline #
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var BioEntity = require("./BioEntity"); var BioEntity = require("./BioEntity");
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger'); var logger = require('../../logger');
/** /**
...@@ -26,7 +27,7 @@ function Alias(javaObject) { ...@@ -26,7 +27,7 @@ function Alias(javaObject) {
} }
if (this._modelId === undefined) { if (this._modelId === undefined) {
throw new Error("ModelId is not defined for alias", javaObject); throw new Error("ModelId is not defined for alias");
} }
if (javaObject.name === undefined) { if (javaObject.name === undefined) {
......
...@@ -40,8 +40,8 @@ AliasMarker.prototype.setAliasData = function (data) { ...@@ -40,8 +40,8 @@ AliasMarker.prototype.setAliasData = function (data) {
* @returns {google.maps.Point} - coordinates where marker is pointing * @returns {google.maps.Point} - coordinates where marker is pointing
*/ */
AliasMarker.prototype.getCoordinates = function () { AliasMarker.prototype.getCoordinates = function () {
return new google.maps.Point(this._aliasData.x + this._aliasData.width / 2, this._aliasData.y var alias = this.getAliasData();
+ this._aliasData.height / 2); return new google.maps.Point(alias.getX() + alias.getWidth() / 2, alias.getY() + alias.getHeight() / 2);
}; };
AliasMarker.prototype.init = function () { AliasMarker.prototype.init = function () {
......
...@@ -8,7 +8,7 @@ var ObjectWithListeners = require('../../ObjectWithListeners'); ...@@ -8,7 +8,7 @@ var ObjectWithListeners = require('../../ObjectWithListeners');
* Class representing abstract overlay element on the map relevant for a * Class representing abstract overlay element on the map relevant for a
* specific layout. * specific layout.
*/ */
function AbstractOverlayElement(params) { function AbstractSurfaceElement(params) {
var self = this; var self = this;
// call super constructor // call super constructor
ObjectWithListeners.call(this); ObjectWithListeners.call(this);
...@@ -31,16 +31,16 @@ function AbstractOverlayElement(params) { ...@@ -31,16 +31,16 @@ function AbstractOverlayElement(params) {
} }
} }
AbstractOverlayElement.prototype = Object.create(ObjectWithListeners.prototype); AbstractSurfaceElement.prototype = Object.create(ObjectWithListeners.prototype);
AbstractOverlayElement.prototype.constructor = AbstractOverlayElement; AbstractSurfaceElement.prototype.constructor = AbstractSurfaceElement;
AbstractOverlayElement.prototype.setMap = function(map) { AbstractSurfaceElement.prototype.setMap = function (map) {
for (var i = 0; i < this.getGoogleMapObjects().length; i++) { for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
this.getGoogleMapObjects()[i].setMap(map); this.getGoogleMapObjects()[i].setMap(map);
} }
}; };
AbstractOverlayElement.prototype.getBounds = function() { AbstractSurfaceElement.prototype.getBounds = function () {
var bounds = new google.maps.LatLngBounds(); var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < this.getGoogleMapObjects().length; i++) { for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
bounds.extend(this.getGoogleMapObjects()[i].getBounds().getSouthWest()); bounds.extend(this.getGoogleMapObjects()[i].getBounds().getSouthWest());
...@@ -49,7 +49,7 @@ AbstractOverlayElement.prototype.getBounds = function() { ...@@ -49,7 +49,7 @@ AbstractOverlayElement.prototype.getBounds = function() {
return bounds; return bounds;
}; };
AbstractOverlayElement.prototype.isShown = function() { AbstractSurfaceElement.prototype.isShown = function () {
var result = false; var result = false;
for (var i = 0; i < this.getGoogleMapObjects().length; i++) { for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
var map = this.getGoogleMapObjects()[i].getMap(); var map = this.getGoogleMapObjects()[i].getMap();
...@@ -61,7 +61,7 @@ AbstractOverlayElement.prototype.isShown = function() { ...@@ -61,7 +61,7 @@ AbstractOverlayElement.prototype.isShown = function() {
return result; return result;
}; };
AbstractOverlayElement.prototype.show = function() { AbstractSurfaceElement.prototype.show = function () {
if (this.isShown()) { if (this.isShown()) {
logger.warn("Surface already shown"); logger.warn("Surface already shown");
return; return;
...@@ -69,51 +69,60 @@ AbstractOverlayElement.prototype.show = function() { ...@@ -69,51 +69,60 @@ AbstractOverlayElement.prototype.show = function() {
this.setMap(this.getCustomMap().getGoogleMap()); this.setMap(this.getCustomMap().getGoogleMap());
}; };
AbstractOverlayElement.prototype.hide = function() { AbstractSurfaceElement.prototype.hide = function () {
this.setMap(null); this.setMap(null);
}; };
AbstractOverlayElement.prototype.onClickHandler = function() { AbstractSurfaceElement.prototype.onClickHandler = function () {
return this.callListeners("onClick"); return this.callListeners("onClick");
}; };
AbstractOverlayElement.prototype.getGoogleMarker = function() { AbstractSurfaceElement.prototype.getGoogleMarker = function () {
return this.getGoogleMapObjects()[0]; return this.getGoogleMapObjects()[0];
}; };
AbstractOverlayElement.prototype.getGoogleMapObjects = function() { AbstractSurfaceElement.prototype.getGoogleMapObjects = function () {
return this._googleMapObjects; return this._googleMapObjects;
}; };
AbstractOverlayElement.prototype.addGoogleMapObject = function(googleObject) { AbstractSurfaceElement.prototype.addGoogleMapObject = function (googleObject) {
this._googleMapObjects.push(googleObject); this._googleMapObjects.push(googleObject);
var self = this; var self = this;
var onclick = function() { var onclick = function () {
return self.onClickHandler(); return self.onClickHandler();
}; };
google.maps.event.addListener(googleObject, 'click', onclick); google.maps.event.addListener(googleObject, 'click', onclick);
}; };
AbstractOverlayElement.prototype.getIdentifiedElement = function() { AbstractSurfaceElement.prototype.getIdentifiedElement = function () {
return this._identifiedElement; return this._identifiedElement;
}; };
AbstractOverlayElement.prototype.getModelId = function() { AbstractSurfaceElement.prototype.setIdentifiedElement = function (identifiedElement) {
this._identifiedElement = identifiedElement;
};
AbstractSurfaceElement.prototype.getBioEntity = function () {
return this._bioEntity;
};
AbstractSurfaceElement.prototype.setBioEntity = function (bioEntity) {
this._bioEntity = bioEntity;
};
AbstractSurfaceElement.prototype.getModelId = function () {
return this.getIdentifiedElement().getModelId(); return this.getIdentifiedElement().getModelId();
}; };
AbstractOverlayElement.prototype.updateIdentifiedElement = function(identifiedElement) { AbstractSurfaceElement.prototype.updateIdentifiedElement = function (identifiedElement) {
if (identifiedElement.getColor() !== undefined) { if (identifiedElement.getColor() !== undefined) {
this.setColor(identifiedElement.getColor()); this.setColor(identifiedElement.getColor());
} }
}; };
AbstractOverlayElement.prototype.setIdentifiedElement = function(identifiedElement) { AbstractSurfaceElement.prototype.getBounds = function () {
this._identifiedElement = identifiedElement;
};
AbstractOverlayElement.prototype.getBounds = function() {
var self = this; var self = this;
var bounds = new google.maps.LatLngBounds(); var bounds = new google.maps.LatLngBounds();
for (var i = 0; i < self.getGoogleMapObjects().length; i++) { for (var i = 0; i < self.getGoogleMapObjects().length; i++) {
...@@ -127,15 +136,15 @@ AbstractOverlayElement.prototype.getBounds = function() { ...@@ -127,15 +136,15 @@ AbstractOverlayElement.prototype.getBounds = function() {
/** /**
* Returns {@link AbstractCustomMap} where surface is located. * Returns {@link AbstractCustomMap} where surface is located.
* *
* @returns {@link AbstractCustomMap} where surface is located * @returns {AbstractCustomMap} where surface is located
*/ */
AbstractOverlayElement.prototype.getCustomMap = function() { AbstractSurfaceElement.prototype.getCustomMap = function () {
return this._customMap; return this._customMap;
}; };
AbstractOverlayElement.prototype.setCustomMap = function(customMap) { AbstractSurfaceElement.prototype.setCustomMap = function (customMap) {
this._customMap = customMap; this._customMap = customMap;
}; };
module.exports = AbstractOverlayElement; module.exports = AbstractSurfaceElement;
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* exported logger */ /* exported logger */
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger'); var logger = require('../../logger');
var functions = require('../../Functions'); var functions = require('../../Functions');
...@@ -20,18 +21,18 @@ function AliasSurface(params) { ...@@ -20,18 +21,18 @@ function AliasSurface(params) {
this.addGoogleMapObject(params.gmapObj); this.addGoogleMapObject(params.gmapObj);
// original data // original data
this.aliasData = params.alias; this.setBioEntity(params.alias);
} }
AliasSurface.prototype = Object.create(AbstractSurfaceElement.prototype); AliasSurface.prototype = Object.create(AbstractSurfaceElement.prototype);
AliasSurface.prototype.constructor = AliasSurface; AliasSurface.prototype.constructor = AliasSurface;
AliasSurface.prototype.setColor = function(color) { AliasSurface.prototype.setColor = function (color) {
this._color = color; this._color = color;
var googleMapObjects = this.getGoogleMapObjects(); var googleMapObjects = this.getGoogleMapObjects();
for (var i = 0; i < googleMapObjects.length; i++) { for (var i = 0; i < googleMapObjects.length; i++) {
googleMapObjects[i].setOptions({ googleMapObjects[i].setOptions({
strokeColor : color, strokeColor: color
}); });
} }
}; };
...@@ -40,16 +41,16 @@ AliasSurface.prototype.setColor = function(color) { ...@@ -40,16 +41,16 @@ AliasSurface.prototype.setColor = function(color) {
* Function used to recalculate boundaries of the {@link AliasSurface}. * Function used to recalculate boundaries of the {@link AliasSurface}.
* Boundaries define how big part of original alias is taken by this layout * Boundaries define how big part of original alias is taken by this layout
* visualization. * visualization.
* *
* @param startX * @param startX
* value between 0..1 defining where should be the start on OX axis * value between 0..1 defining where should be the start on OX axis
* @param endX * @param endX
* value between 0..1 defining where should be the end on OX axis * value between 0..1 defining where should be the end on OX axis
*/ */
AliasSurface.prototype.setBoundsForAlias = function(startX, endX) { AliasSurface.prototype.setBoundsForAlias = function (startX, endX) {
var pointA = new google.maps.Point(this.aliasData.x + startX * this.aliasData.width, this.aliasData.y); var alias = this.getBioEntity();
var pointB = new google.maps.Point(this.aliasData.x + endX * this.aliasData.width, this.aliasData.y var pointA = new google.maps.Point(alias.x + startX * alias.width, alias.y);
+ this.aliasData.height); var pointB = new google.maps.Point(alias.x + endX * alias.width, alias.y + alias.height);
var latLngA = this.getCustomMap().fromPointToLatLng(pointA); var latLngA = this.getCustomMap().fromPointToLatLng(pointA);
var latLngB = this.getCustomMap().fromPointToLatLng(pointB); var latLngB = this.getCustomMap().fromPointToLatLng(pointB);
...@@ -61,7 +62,7 @@ AliasSurface.prototype.setBoundsForAlias = function(startX, endX) { ...@@ -61,7 +62,7 @@ AliasSurface.prototype.setBoundsForAlias = function(startX, endX) {
/** /**
* Creates {@link AliasSurface}. * Creates {@link AliasSurface}.
* *
* @param params * @param params
* dict containing set of information required for surface creation: * dict containing set of information required for surface creation:
* <li>overlayAlias - {@link LayoutAlias} for which overlay is created * <li>overlayAlias - {@link LayoutAlias} for which overlay is created
...@@ -79,7 +80,7 @@ AliasSurface.prototype.setBoundsForAlias = function(startX, endX) { ...@@ -79,7 +80,7 @@ AliasSurface.prototype.setBoundsForAlias = function(startX, endX) {
* starting point of the overlay * starting point of the overlay
* @returns {AliasSurface} * @returns {AliasSurface}
*/ */
AliasSurface.create = function(params) { AliasSurface.create = function (params) {
var overlayAlias = params.overlayAlias; var overlayAlias = params.overlayAlias;
var alias = params.alias; var alias = params.alias;
var map = params.map; var map = params.map;
...@@ -95,32 +96,32 @@ AliasSurface.create = function(params) { ...@@ -95,32 +96,32 @@ AliasSurface.create = function(params) {
bounds.extend(latLngA); bounds.extend(latLngA);
bounds.extend(latLngB); bounds.extend(latLngB);
var rectangle = new google.maps.Rectangle({ var rectangle = new google.maps.Rectangle({
fillOpacity : 0.8, fillOpacity: 0.8,
strokeWeight : 1, strokeWeight: 1,
map : map.getGoogleMap(), map: map.getGoogleMap(),
bounds : bounds bounds: bounds
}); });
return functions.overlayToColor(overlayAlias).then(function(color) { return functions.overlayToColor(overlayAlias).then(function (color) {
rectangle.setOptions({ rectangle.setOptions({
fillColor : color, fillColor: color
}); });
var result = new AliasSurface({ var result = new AliasSurface({
map : map, map: map,
gmapObj : rectangle, gmapObj: rectangle,
alias : alias, alias: alias,
onClick : params.onClick onClick: params.onClick
}); });
result.setIdentifiedElement(new IdentifiedElement(alias)); result.setIdentifiedElement(new IdentifiedElement(alias));
return result; return result;
}); });
}; };
AliasSurface.createFromIdentifiedElement = function(params) { AliasSurface.createFromIdentifiedElement = function (params) {
var element = params.element; var element = params.element;
var map = params.map; var map = params.map;
var model = map.getModel().getSubmodelById(element.getModelId()); var model = map.getModel().getSubmodelById(element.getModelId());
return model.getByIdentifiedElement(element).then(function(alias) { return model.getByIdentifiedElement(element).then(function (alias) {
var pointA = new google.maps.Point(alias.getX(), alias.getY()); var pointA = new google.maps.Point(alias.getX(), alias.getY());
var pointB = new google.maps.Point(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight()); var pointB = new google.maps.Point(alias.getX() + alias.getWidth(), alias.getY() + alias.getHeight());
var latLngA = map.fromPointToLatLng(pointA); var latLngA = map.fromPointToLatLng(pointA);
...@@ -152,21 +153,21 @@ AliasSurface.createFromIdentifiedElement = function(params) { ...@@ -152,21 +153,21 @@ AliasSurface.createFromIdentifiedElement = function(params) {
} }
var rectangle = new google.maps.Rectangle({ var rectangle = new google.maps.Rectangle({
map : map.getGoogleMap(), map: map.getGoogleMap(),
bounds : bounds, bounds: bounds,
fillOpacity : fillOpacity, fillOpacity: fillOpacity,
fillColor : color, fillColor: color,
strokeColor : strokeColor, strokeColor: strokeColor,
strokeOpacity : strokeOpacity, strokeOpacity: strokeOpacity,
strokeWeight : strokeWeight, strokeWeight: strokeWeight
}); });
var result = new AliasSurface({ var result = new AliasSurface({
gmapObj : rectangle, gmapObj: rectangle,
map : map, map: map,
onClick : params.onClick, onClick: params.onClick,
alias : alias, alias: alias
}); });
result.setIdentifiedElement(element); result.setIdentifiedElement(element);
return result; return result;
......
"use strict"; "use strict";
var Promise = require("bluebird");
/* exported logger */ /* exported logger */
var functions = require('../../Functions'); var functions = require('../../Functions');
...@@ -29,7 +31,7 @@ function ReactionSurface(params) { ...@@ -29,7 +31,7 @@ function ReactionSurface(params) {
AbstractSurfaceElement.call(this, params); AbstractSurfaceElement.call(this, params);
var overlayData = params.layoutReaction; var overlayData = params.layoutReaction;
this.setReactionData(params.reaction); this.setBioEntity(params.reaction);
var color = params.color; var color = params.color;
this.width = 5.0; this.width = 5.0;
...@@ -46,7 +48,7 @@ function ReactionSurface(params) { ...@@ -46,7 +48,7 @@ function ReactionSurface(params) {
this.setColor(color); this.setColor(color);
this.setCustomized(params.customized); this.setCustomized(params.customized);
this.setIdentifiedElement(new IdentifiedElement(this.getReactionData())); this.setIdentifiedElement(new IdentifiedElement(this.getBioEntity()));
this.init(); this.init();
} }
...@@ -89,7 +91,7 @@ ReactionSurface.prototype.setColor = function (color) { ...@@ -89,7 +91,7 @@ ReactionSurface.prototype.setColor = function (color) {
var gmapObjects = this.getGoogleMapObjects(); var gmapObjects = this.getGoogleMapObjects();
for (var i = 0; i < gmapObjects.length; i++) { for (var i = 0; i < gmapObjects.length; i++) {
gmapObjects[i].setOptions({ gmapObjects[i].setOptions({
strokeColor: color, strokeColor: color
}); });
} }
this.customized = true; this.customized = true;
...@@ -165,7 +167,7 @@ ReactionSurface.prototype.changedToDefault = function () { ...@@ -165,7 +167,7 @@ ReactionSurface.prototype.changedToDefault = function () {
for (var i = 0; i < this.getGoogleMapObjects().length; i++) { for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
this.getGoogleMapObjects()[i].setOptions({ this.getGoogleMapObjects()[i].setOptions({
strokeColor: "#0000FF", strokeColor: "#0000FF",
strokeWeight: 5, strokeWeight: 5
}); });
} }
this.customized = false; this.customized = false;
...@@ -175,11 +177,11 @@ ReactionSurface.prototype.changedToDefault = function () { ...@@ -175,11 +177,11 @@ ReactionSurface.prototype.changedToDefault = function () {
* Changes visualization of the ReactionSurface to customized mode where we mark * Changes visualization of the ReactionSurface to customized mode where we mark
* reaction as highlighted with customized reaction layout data. * reaction as highlighted with customized reaction layout data.
*/ */
ReactionSurface.prototype.changedToCustomized = function() { ReactionSurface.prototype.changedToCustomized = function () {
for (var i = 0; i < this.getGoogleMapObjects().length; i++) { for (var i = 0; i < this.getGoogleMapObjects().length; i++) {
this.getGoogleMapObjects()[i].setOptions({ this.getGoogleMapObjects()[i].setOptions({
strokeColor: this.getColor(), strokeColor: this.getColor(),
strokeWeight: this.getWidth(), strokeWeight: this.getWidth()
}); });
} }
this.customized = true; this.customized = true;
...@@ -215,15 +217,6 @@ ReactionSurface.createLine = function (line, color, width, map) { ...@@ -215,15 +217,6 @@ ReactionSurface.createLine = function (line, color, width, map) {
return googleLine; return googleLine;
}; };
/**
* Returns {@link Reaction} data for this marker.
*
* @returns {@link Reaction} data for this marker
*/
ReactionSurface.prototype.getReactionData = function () {
return this.reactionData;
};
ReactionSurface.prototype.getId = function () { ReactionSurface.prototype.getId = function () {
return this._id; return this._id;
}; };
...@@ -232,11 +225,11 @@ ReactionSurface.prototype.setId = function (id) { ...@@ -232,11 +225,11 @@ ReactionSurface.prototype.setId = function (id) {
this._id = id; this._id = id;
}; };
ReactionSurface.prototype.setReactionData = function (value) { ReactionSurface.prototype.setBioEntity = function (value) {
if (value === undefined || value === null) { if (value === undefined || value === null) {
throw new Error("Reaction must be defined"); throw new Error("Reaction must be defined");
} }
this.reactionData = value; AbstractSurfaceElement.prototype.setBioEntity.call(this, value);
this.setId(value.getId()); this.setId(value.getId());
}; };
...@@ -245,21 +238,22 @@ ReactionSurface.prototype.isCustomized = function () { ...@@ -245,21 +238,22 @@ ReactionSurface.prototype.isCustomized = function () {
}; };
ReactionSurface.prototype.init = function () { ReactionSurface.prototype.init = function () {
var reaction = this.getBioEntity();
var i; var i;
var line; var line;
var googleLine; var googleLine;
for (i = 0; i < this.reactionData.startLines.length; i++) { for (i = 0; i < reaction.startLines.length; i++) {
line = this.reactionData.startLines[i]; line = reaction.startLines[i];
googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap()); googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap());
this.addGoogleMapObject(googleLine); this.addGoogleMapObject(googleLine);
} }
for (i = 0; i < this.reactionData.endLines.length; i++) { for (i = 0; i < reaction.endLines.length; i++) {
line = this.reactionData.endLines[i]; line = reaction.endLines[i];
googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap()); googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap());
this.addGoogleMapObject(googleLine); this.addGoogleMapObject(googleLine);
} }
for (i = 0; i < this.reactionData.midLines.length; i++) { for (i = 0; i < reaction.midLines.length; i++) {
line = this.reactionData.midLines[i]; line = reaction.midLines[i];
googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap()); googleLine = ReactionSurface.createLine(line, this.getColor(), this.width, this.getCustomMap());
this.addGoogleMapObject(googleLine); this.addGoogleMapObject(googleLine);
} }
......
...@@ -61,70 +61,91 @@ describe('Alias', function () { ...@@ -61,70 +61,91 @@ describe('Alias', function () {
}); });
it("Alias update method", function () { describe("update", function () {
var javaObject = { describe("from json", function () {
bounds: { it("full update", function () {
x: 190, var javaObject = {
y: 44, bounds: {
width: 80, x: 190,
height: 40 y: 44,
}, width: 80,
modelId: 57, height: 40
idObject: 18554 },
}; modelId: 57,
var alias = new Alias(javaObject); idObject: 18554
var javaObject2 = { };
notes: "", var alias = new Alias(javaObject);
type: "Protein", var javaObject2 = {
name: "s1", notes: "",
synonyms: [], type: "Protein",
formerSymbols: [], name: "s1",
references: [], synonyms: [],
other: [], formerSymbols: [],
bounds: { references: [],
x: 59, other: [],
y: 73, bounds: {
width: 80, x: 59,
height: 40 y: 73,
}, width: 80,
modelId: 54, height: 40
idObject: 18552 },
}; modelId: 54,
alias.update(javaObject2); idObject: 18552
assert.ok(alias.isComplete()); };
assert.equal('s1', alias.name); 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 () { it("from Alias", function () {
var javaObject = { var javaObject = {
bounds: { bounds: {
x: 190, x: 190,
y: 44, y: 44,
width: 80, width: 80,
height: 40 height: 40
}, },
modelId: 57, modelId: 57,
idObject: 18554 idObject: 18554
}; };
var alias = new Alias(javaObject); var alias = new Alias(javaObject);
var javaObject2 = { var alias2 = new Alias(javaObject);
notes: "", alias.update(alias2);
type: "Protein", assert.equal(alias.isComplete(), false);
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);
}); });
}); });
...@@ -7,6 +7,7 @@ var LayoutData = require('../../../../main/js/map/data/LayoutData'); ...@@ -7,6 +7,7 @@ var LayoutData = require('../../../../main/js/map/data/LayoutData');
var MapModel = require('../../../../main/js/map/data/MapModel'); var MapModel = require('../../../../main/js/map/data/MapModel');
var NetworkError = require('../../../../main/js/NetworkError'); var NetworkError = require('../../../../main/js/NetworkError');
var PointData = require('../../../../main/js/map/data/PointData'); var PointData = require('../../../../main/js/map/data/PointData');
var ServerConnector = require('../../ServerConnector-mock');
var assert = require('chai').assert; var assert = require('chai').assert;
......
...@@ -23,7 +23,7 @@ describe('ReactionSurface', function () { ...@@ -23,7 +23,7 @@ describe('ReactionSurface', function () {
assert.ok(reactionOverlay.getColor()); assert.ok(reactionOverlay.getColor());
assert.ok(reactionOverlay.getWidth()); assert.ok(reactionOverlay.getWidth());
assert.ok(reactionOverlay.getBounds()); assert.ok(reactionOverlay.getBounds());
assert.ok(reactionOverlay.getReactionData()); assert.ok(reactionOverlay.getBioEntity());
assert.ok(reactionOverlay.getCustomMap()); assert.ok(reactionOverlay.getCustomMap());
assert.ok(reactionOverlay.getId()); assert.ok(reactionOverlay.getId());
assert.ok(typeof reactionOverlay.getColor() === "string"); assert.ok(typeof reactionOverlay.getColor() === "string");
...@@ -44,7 +44,7 @@ describe('ReactionSurface', function () { ...@@ -44,7 +44,7 @@ describe('ReactionSurface', function () {
assert.ok(reactionOverlay.getColor()); assert.ok(reactionOverlay.getColor());
assert.ok(reactionOverlay.getWidth()); assert.ok(reactionOverlay.getWidth());
assert.ok(reactionOverlay.getBounds()); assert.ok(reactionOverlay.getBounds());
assert.ok(reactionOverlay.getReactionData()); assert.ok(reactionOverlay.getBioEntity());
assert.ok(reactionOverlay.getCustomMap()); assert.ok(reactionOverlay.getCustomMap());
assert.ok(reactionOverlay.getId()); assert.ok(reactionOverlay.getId());
assert.ok(typeof reactionOverlay.getColor() === "string"); assert.ok(typeof reactionOverlay.getColor() === "string");
......
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