add a couple of DomUtil tests, #1347

This commit is contained in:
Vladimir Agafonkin 2013-02-05 17:01:01 +02:00
parent f01e32d764
commit c327fa89ee

View File

@ -53,6 +53,34 @@ describe('DomUtil', function() {
}) })
}); });
describe('#documentIsLtr', function () {
it('should return true if doc direction is ltr', function () {
expect(L.DomUtil.documentIsLtr()).toBe(true);
expect(L.DomUtil.documentIsLtr()).toBe(true); // cached
});
});
describe('#getViewportOffset', function () {
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.top = '100px';
div.style.left = '200px';
div.style.border = '10px solid black';
div.style.padding = '50px';
div.style.visibility = 'hidden';
var div2 = document.createElement('div');
div.style.marginTop = '100px';
div.appendChild(div2);
document.body.appendChild(div);
expect(L.DomUtil.getViewportOffset(div2)).toEqual(new L.Point(260, 260));
document.body.removeChild(div);
});
describe('#setPosition', noSpecs); describe('#setPosition', noSpecs);
describe('#getStyle', noSpecs); describe('#getStyle', noSpecs);