From ca7f79c896f07e232babce6de4af041fb877fa67 Mon Sep 17 00:00:00 2001 From: nein09 Date: Thu, 13 Nov 2014 09:04:11 -0800 Subject: [PATCH] Aspect ratio test --- test/viewport.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/test/viewport.js b/test/viewport.js index 643a9841..679ac3cf 100644 --- a/test/viewport.js +++ b/test/viewport.js @@ -63,13 +63,26 @@ viewer.open(DZI_PATH); }); */ + asyncTest('getAspectRatio', function() { + var openHandler = function(event) { + viewer.removeHandler('open', openHandler); + var viewport = viewer.viewport; + viewport.zoomTo(ZOOM_FACTOR, null, true); + + equal(viewport.getAspectRatio(), 1, "Test aspect ratio") + start(); + }; + viewer.addHandler('open', openHandler); + viewer.open(DZI_PATH); + }); + asyncTest('getMinZoomDefault', function() { var openHandler = function(event) { viewer.removeHandler('open', openHandler); var viewport = viewer.viewport; viewport.zoomTo(ZOOM_FACTOR, null, true); - equal(viewport.getMinZoom(), .9, "Test min zoom level") + equal(viewport.getMinZoom(), .9, "Test default min zoom level") start(); }; viewer.addHandler('open', openHandler); @@ -82,7 +95,7 @@ var viewport = viewer.viewport; viewport.zoomTo(ZOOM_FACTOR, null, true); - equal(viewport.getMaxZoom(), 2.2, "Test max zoom level") + equal(viewport.getMaxZoom(), 2.2, "Test default max zoom level") start(); }; viewer.addHandler('open', openHandler);