mirror of
https://github.com/fengyuanchen/viewerjs.git
synced 2026-01-18 15:13:13 +00:00
33 lines
746 B
JavaScript
33 lines
746 B
JavaScript
describe('rotatable (option)', () => {
|
|
it('should be rotatable by default', (done) => {
|
|
const image = window.createImage();
|
|
const viewer = new Viewer(image, {
|
|
inline: true,
|
|
|
|
viewed() {
|
|
viewer.rotateTo(90);
|
|
expect(viewer.imageData.rotate).to.equal(90);
|
|
done();
|
|
},
|
|
});
|
|
|
|
expect(viewer.options.rotatable).to.be.true;
|
|
});
|
|
|
|
it('should not be rotatable', (done) => {
|
|
const image = window.createImage();
|
|
const viewer = new Viewer(image, {
|
|
inline: true,
|
|
rotatable: false,
|
|
|
|
viewed() {
|
|
viewer.rotateTo(90);
|
|
expect(viewer.imageData.rotate).to.not.equal(90);
|
|
done();
|
|
},
|
|
});
|
|
|
|
expect(viewer.options.rotatable).to.be.false;
|
|
});
|
|
});
|