fix browser test runner, close #1418
This commit is contained in:
parent
a0dd4a60e9
commit
aea0e3b05b
@ -8,7 +8,7 @@
|
||||
<script type="text/javascript" src="happen.js"></script>
|
||||
|
||||
<!-- source files -->
|
||||
<script type="text/javascript" src="context.js"></script>
|
||||
<script type="text/javascript" src="before.js"></script>
|
||||
<script type="text/javascript" src="../build/deps.js"></script>
|
||||
|
||||
<script type="text/javascript" src="../debug/leaflet-include.js"></script>
|
||||
@ -22,6 +22,7 @@
|
||||
<!-- /control -->
|
||||
<script type="text/javascript" src="suites/control/Control.LayersSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/control/Control.ScaleSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/control/Control.AttributionSpec.js"></script>
|
||||
|
||||
<!-- /core -->
|
||||
<script type="text/javascript" src="suites/core/UtilSpec.js"></script>
|
||||
@ -32,6 +33,8 @@
|
||||
<script type="text/javascript" src="suites/geometry/PointSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/geometry/BoundsSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/geometry/TransformationSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/geometry/LineUtilSpec.js"></script>
|
||||
<script type="text/javascript" src="suites/geometry/PolyUtilSpec.js"></script>
|
||||
|
||||
<!-- /geo -->
|
||||
<script type="text/javascript" src="suites/geo/LatLngSpec.js"></script>
|
||||
|
@ -61,24 +61,26 @@ describe('DomUtil', function() {
|
||||
});
|
||||
|
||||
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';
|
||||
it('should calculate and return viewport offset of an element', 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';
|
||||
var div2 = document.createElement('div');
|
||||
div.style.marginTop = '100px';
|
||||
|
||||
div.appendChild(div2);
|
||||
div.appendChild(div2);
|
||||
|
||||
document.body.appendChild(div);
|
||||
document.body.appendChild(div);
|
||||
|
||||
expect(L.DomUtil.getViewportOffset(div2)).toEqual(new L.Point(260, 260));
|
||||
expect(L.DomUtil.getViewportOffset(div2)).toEqual(new L.Point(260, 260));
|
||||
|
||||
document.body.removeChild(div);
|
||||
document.body.removeChild(div);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setPosition', noSpecs);
|
||||
|
Loading…
Reference in New Issue
Block a user