Adding unit tests.

This commit is contained in:
ahocevar
2012-06-13 23:14:34 +02:00
parent 032df4b90a
commit fe31af5c80
2 changed files with 29 additions and 1 deletions

View File

@@ -2047,7 +2047,7 @@
}
function test_adjustZoom(t) {
t.plan(4);
t.plan(5);
var map = new OpenLayers.Map({
div: 'map',
layers: [
@@ -2062,6 +2062,9 @@
t.eq(map.adjustZoom(9), 9, "valid zoom maintained");
t.eq(map.adjustZoom(1), 2, "zoom adjusted to not exceed world width");
map.fractionalZoom = true;
t.eq(map.adjustZoom(1).toPrecision(3), "1.29", "zoom adjusted to match world width");
map.moveTo([16, 48], 0);
t.eq(map.getCenter().toShortString(), "0, 0", "no panning when moveTo is called with invalid zoom");