aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/options/rotatable.spec.js
blob: 01a9ad09abf5269bb039ba5af9d3fec44f7f7dc4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
  });
});