aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/options/rotatable.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/specs/options/rotatable.spec.js')
-rw-r--r--library/cropperjs/test/specs/options/rotatable.spec.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/library/cropperjs/test/specs/options/rotatable.spec.js b/library/cropperjs/test/specs/options/rotatable.spec.js
new file mode 100644
index 000000000..01a9ad09a
--- /dev/null
+++ b/library/cropperjs/test/specs/options/rotatable.spec.js
@@ -0,0 +1,28 @@
+describe('rotatable (option)', () => {
+ it('should be rotatable by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+
+ ready() {
+ expect(cropper.rotate(90).getImageData().rotate).to.equal(90);
+ done();
+ },
+ });
+
+ expect(cropper.options.rotatable).to.be.true;
+ });
+
+ it('should not be rotatable', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ rotatable: false,
+
+ ready() {
+ expect(cropper.rotate(90).getImageData().rotate).to.be.undefined;
+ done();
+ },
+ });
+
+ expect(cropper.options.rotatable).to.be.false;
+ });
+});