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

method names refactored

parent 700cc6e7
No related branches found
No related tags found
1 merge request!8Resolve "missing methods for JS app API"
......@@ -216,7 +216,7 @@ function createResult(customMap) {
getProject : function() {
return customMap.getProject();
},
getElementById : function(param) {
getBioEntityById : function(param) {
var identifiedElement = new IdentifiedElement(param);
var model = customMap.getModel().getSubmodelById(identifiedElement.getModelId());
return model.getByIdentifiedElement(identifiedElement, true);
......@@ -226,14 +226,14 @@ function createResult(customMap) {
customMap.destroy();
});
},
showElement : function(params) {
showBioEntity : function(params) {
var iconElements = createMarkerElements(params, "ICON", true);
var surfaceElements = createMarkerElements(params, "SURFACE", false);
return customMap.getOverlayByName("user").addMarker(iconElements).then(function() {
return customMap.getOverlayByName("user").addSurface(surfaceElements);
});
},
hideElement : function(params) {
hideBioEntity : function(params) {
var iconElements = createMarkerElements(params, "ICON", true);
var surfaceElements = createMarkerElements(params, "SURFACE", false);
return customMap.getOverlayByName("user").removeMarker(iconElements).then(function() {
......
......@@ -238,7 +238,7 @@ describe('minerva global', function() {
});
});
it("getElementById", function() {
it("getBioEntityById", function() {
var options = {
projectId : "sample",
element : testDiv
......@@ -246,7 +246,7 @@ describe('minerva global', function() {
var globalResult;
return minerva.create(options).then(function(result) {
globalResult = result;
return result.getElementById({
return result.getBioEntityById({
id : 329177,
modelId : 15781,
type : "ALIAS"
......@@ -287,14 +287,26 @@ describe('minerva global', function() {
};
return minerva.create(options).then(function(result) {
globalResult = result;
return globalResult.showElement(elementToShow);
return globalResult.showBioEntity(elementToShow);
}).then(function() {
return globalResult.showElement(elementToShow2);
return globalResult.getHighlightedBioEntities();
}).then(function(elements) {
assert.equal(elements.length, 1);
return globalResult.showBioEntity(elementToShow2);
}).then(function() {
return globalResult.hideElement(elementToShow);
return globalResult.getHighlightedBioEntities();
}).then(function(elements) {
assert.equal(elements.length, 2);
return globalResult.hideBioEntity(elementToShow);
}).then(function() {
return globalResult.hideElement(elementToShow2);
return globalResult.getHighlightedBioEntities();
}).then(function(elements) {
assert.equal(elements.length, 1);
return globalResult.hideBioEntity(elementToShow2);
}).then(function() {
return globalResult.getHighlightedBioEntities();
}).then(function(elements) {
assert.equal(elements.length, 0);
globalResult.destroy();
});
});
......
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