diff --git a/frontend-js/src/main/js/map/surface/AliasSurface.js b/frontend-js/src/main/js/map/surface/AliasSurface.js index 9226528c69f5f3a967286d4c49a46f18ee117dfd..f7dc2968bc2c47f7f20d80ad3847b9fc11c9ecdc 100644 --- a/frontend-js/src/main/js/map/surface/AliasSurface.js +++ b/frontend-js/src/main/js/map/surface/AliasSurface.js @@ -251,7 +251,7 @@ AliasSurface.prototype.getEndX = function () { */ AliasSurface.prototype.setEndX = function (endX) { if (endX === undefined) { - endX = 0; + endX = 1; } this._endX = endX; }; diff --git a/frontend-js/src/test/js/map/surface/AliasSurface-test.js b/frontend-js/src/test/js/map/surface/AliasSurface-test.js index 5658cfd95042e91916aed4e6863c48e7a78b9d08..92ec4e60627ac61e2e6b09ae1a93b56ef40c7d48 100644 --- a/frontend-js/src/test/js/map/surface/AliasSurface-test.js +++ b/frontend-js/src/test/js/map/surface/AliasSurface-test.js @@ -9,21 +9,38 @@ var ServerConnector = require('../../ServerConnector-mock'); var assert = require('assert'); describe('AliasSurface', function () { - it("init", function () { - var map = helper.createCustomMap(); - var alias = helper.createAlias(map); - var layoutAlias = helper.createLayoutAlias(alias); + describe("init", function () { + it("default", function () { + var map = helper.createCustomMap(); + var alias = helper.createAlias(map); + var layoutAlias = helper.createLayoutAlias(alias); - var result = new AliasSurface({ - overlayAlias: layoutAlias, - alias: alias, - map: map, - startX: 1, - endX: 2 + var result = new AliasSurface({ + overlayAlias: layoutAlias, + alias: alias, + map: map, + startX: 1, + endX: 2 + }); + return result.init().then(function () { + assert.equal(logger.getWarnings.length, 0); + assert.ok(result.getIdentifiedElement()); + }); }); - return result.init().then(function () { - assert.equal(logger.getWarnings.length, 0); - assert.ok(result.getIdentifiedElement()); + it("no bounds", function () { + var map = helper.createCustomMap(); + var alias = helper.createAlias(map); + var layoutAlias = helper.createLayoutAlias(alias); + + var result = new AliasSurface({ + overlayAlias: layoutAlias, + alias: alias, + map: map + }); + return result.init().then(function () { + assert.equal(0, result.getStartX()); + assert.equal(1, result.getEndX()); + }); }); });