From e6341ac1e0ac883229c75694328d27a00df0eb85 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 12 Dec 2022 15:21:56 -0800 Subject: [PATCH] Fixed fullyLoaded test when run in browser --- test/modules/tiledimage.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/modules/tiledimage.js b/test/modules/tiledimage.js index 4a075328..a6b962f7 100644 --- a/test/modules/tiledimage.js +++ b/test/modules/tiledimage.js @@ -9,6 +9,7 @@ testLog.reset(); + // eslint-disable-next-line new-cap viewer = OpenSeadragon({ id: 'example', prefixUrl: '/build/openseadragon/images/', @@ -517,12 +518,17 @@ var image = viewer.world.getItemAt(0); assert.equal(image.getFullyLoaded(), false, 'not fully loaded at first'); + // Zoom out enough that we don't start out with all the tiles loaded. + viewer.viewport.zoomBy(0.5, null, true); + var count = 0; var fullyLoadedChangeHandler = function(event) { if (count === 0) { assert.equal(event.fullyLoaded, true, 'event includes true fullyLoaded property'); assert.equal(image.getFullyLoaded(), true, 'image is fully loaded after event'); + + // Zoom in enough that it needs to load some new tiles. viewer.viewport.zoomBy(5, null, true); } else if (count === 1) { assert.equal(event.fullyLoaded, false, 'event includes false fullyLoaded property');