aboutsummaryrefslogblamecommitdiffstats
path: root/library/cropperjs/test/specs/options/rotatable.spec.js
blob: 01a9ad09abf5269bb039ba5af9d3fec44f7f7dc4 (plain) (tree)



























                                                                         
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;
  });
});