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

layout id should be integer

parent 1831c513
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -284,6 +284,7 @@ CustomMap.prototype.openLayout = function(identifier) {
* identifier of the layout to present
*/
CustomMap.prototype.openLayoutById = function(identifier) {
identifier = parseInt(identifier);
logger.debug("Opening layout: " + identifier);
var index = null;
for (var i = 0; i < this.getLayouts().length; i++) {
......
......@@ -28,6 +28,18 @@ describe('CustomMap', function() {
var map = new CustomMap(options);
assert.ok(map);
});
it("customizeGoogleMapView", function() {
var map = helper.createCustomMap();
map.customizeGoogleMapView();
});
it("customizeGoogleMapView 2", function() {
var map = helper.createCustomMap();
map.customizeGoogleMapView(true);
});
it("openLayoutById (not existing)", function() {
var map = helper.createCustomMap();
......@@ -44,6 +56,15 @@ describe('CustomMap', function() {
assert.equal(logger.getErrors().length, 0);
});
it("openLayout (string id)", function() {
var options = helper.createCustomMapOptions();
var model = options.getProject().getModel();
var layout = model.getLayouts()[0];
var map = new CustomMap(options);
map.openLayoutById(layout.getId()+"");
assert.equal(logger.getErrors().length, 0);
});
it("addSelectedLayout", function() {
var layoutId = 90;
var retreiveActiveAliasesForLayoutCount = 0;
......
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