@qooxdoo/framework
Version:
The JS Framework for Coders
68 lines (52 loc) • 1.58 kB
JavaScript
/* ************************************************************************
qooxdoo - the new era of web development
http://qooxdoo.org
Copyright:
2009 1&1 Internet AG, Germany, http://www.1und1.de
License:
MIT: https://opensource.org/licenses/MIT
See the LICENSE file in the project's top-level directory for details.
Authors:
* Fabian Jakobs (fjakobs)
* Christian Hagendorn (chris_schmidt)
************************************************************************ */
qx.Class.define("qx.test.util.placement.DirectAxis",
{
extend : qx.dev.unit.TestCase,
members :
{
setUp : function() {
this.axis = qx.util.placement.DirectAxis;
},
tearDown : function() {
delete this.axis;
},
testEnoughSpace : function()
{
var size = 50;
var target = {start: 500, end: 600};
var offsets = {start: 10, end: 20};
var areaSize = 1000;
this.assertEquals(
430,
this.axis.computeStart(size, target, offsets, areaSize, "edge-start")
);
this.assertEquals(
610,
this.axis.computeStart(size, target, offsets, areaSize, "edge-end")
);
this.assertEquals(
510,
this.axis.computeStart(size, target, offsets, areaSize, "align-start")
);
this.assertEquals(
535,
this.axis.computeStart(size, target, offsets, areaSize, "align-center")
);
this.assertEquals(
530,
this.axis.computeStart(size, target, offsets, areaSize, "align-end")
);
}
}
});