2017-12-07 04:20:39 +03:00
|
|
|
/* global QUnit, $, testLog */
|
2014-11-21 03:02:02 +03:00
|
|
|
|
|
|
|
(function() {
|
|
|
|
var viewer;
|
|
|
|
|
2017-12-07 04:20:39 +03:00
|
|
|
QUnit.module('ReferenceStrip', {
|
|
|
|
beforeEach: function () {
|
|
|
|
$('<div id="example"></div>').appendTo("#qunit-fixture");
|
2014-11-21 03:02:02 +03:00
|
|
|
|
|
|
|
testLog.reset();
|
|
|
|
},
|
2017-12-07 04:20:39 +03:00
|
|
|
afterEach: function () {
|
2014-11-21 03:02:02 +03:00
|
|
|
if (viewer && viewer.close) {
|
|
|
|
viewer.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
viewer = null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// ----------
|
|
|
|
var createViewer = function(options) {
|
|
|
|
options = options || {};
|
|
|
|
viewer = OpenSeadragon(OpenSeadragon.extend({
|
|
|
|
id: 'example',
|
|
|
|
prefixUrl: '/build/openseadragon/images/',
|
|
|
|
springStiffness: 100 // Faster animation = faster tests
|
|
|
|
}, options));
|
|
|
|
};
|
|
|
|
|
|
|
|
// ----------
|
2017-12-07 04:20:39 +03:00
|
|
|
QUnit.test('basics', function(assert) {
|
|
|
|
var done = assert.async();
|
2014-11-21 03:02:02 +03:00
|
|
|
createViewer({
|
|
|
|
sequenceMode: true,
|
|
|
|
showReferenceStrip: true,
|
|
|
|
tileSources: [
|
|
|
|
'/test/data/tall.dzi',
|
|
|
|
'/test/data/wide.dzi',
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2017-12-07 04:20:39 +03:00
|
|
|
assert.ok(viewer.referenceStrip, 'referenceStrip exists');
|
|
|
|
done();
|
2014-11-21 03:02:02 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
})();
|