Commit 8bbfe79a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

alias surfaces use whole alias area if bounds is not defined

parent 2894867a
Pipeline #5564 passed with stage
in 1 minute and 50 seconds
......@@ -251,7 +251,7 @@ AliasSurface.prototype.getEndX = function () {
*/
AliasSurface.prototype.setEndX = function (endX) {
if (endX === undefined) {
endX = 0;
endX = 1;
}
this._endX = endX;
};
......
......@@ -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());
});
});
});
......
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