Commit 62f40b18 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

API responses fixed for chemical unit tests mocks

parent f5a3715b
......@@ -204,7 +204,7 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
// var desc = grouppedAnnotations.keys()[i];
var groupContainer = (inline ? document.createElement("span") : document.createElement("div"));
var descContainer = (inline ? document.createElement("span") : document.createElement("div"));
var annotatorName = annotatorClass ? annotatorsClassMapping[annotatorClass].getName() : "Annotated by curator";
if (inline) {
......
......@@ -109,35 +109,36 @@ describe('ChemicalPanel', function () {
});
it('on searchResults changed', function () {
var map = helper.createCustomMap();
map.getModel().setId(15781);
var chemicalDbOverlay = helper.createChemicalDbOverlay(map);
new ChemicalPanel({
element: testDiv,
customMap: map
});
return ServerConnector.getProject().then(function (project) {
var map = helper.createCustomMap(project);
var chemicalDbOverlay = helper.createChemicalDbOverlay(map);
new ChemicalPanel({
element: testDiv,
customMap: map
});
return chemicalDbOverlay.searchByQuery("rotenone").then(function () {
assert.equal(logger.getWarnings().length, 1);
return chemicalDbOverlay.searchByQuery("rotenone");
}).then(function () {
assert.equal(logger.getWarnings().length, 0);
assert.ok(testDiv.innerHTML.indexOf("marker/mechanism") >= 0);
});
});
it('searchByQuery', function () {
var map = helper.createCustomMap();
map.getModel().setId(15781);
helper.createChemicalDbOverlay(map);
return ServerConnector.getProject().then(function (project) {
var map = helper.createCustomMap(project);
helper.createChemicalDbOverlay(map);
var panel = new ChemicalPanel({
element: testDiv,
customMap: map
});
var panel = new ChemicalPanel({
element: testDiv,
customMap: map
});
panel.getControlElement(PanelControlElementType.SEARCH_INPUT).value = "rotenone";
panel.getControlElement(PanelControlElementType.SEARCH_INPUT).value = "rotenone";
return panel.searchByQuery().then(function () {
assert.equal(logger.getWarnings().length, 1);
return panel.searchByQuery();
}).then(function () {
assert.equal(logger.getWarnings().length, 0);
assert.ok(testDiv.innerHTML.indexOf("Rotenone ") >= 0);
});
});
......@@ -178,4 +179,5 @@ describe('ChemicalPanel', function () {
});
});
})
;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment