aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/methods/scaleY.spec.js
blob: f983a2fbfd23c707f547d27a04ff473409592745 (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
describe('scaleY (method)', () => {
  it('should be scaled in the y-axis', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      ready() {
        const imageData = cropper.scaleY(-1).getImageData();

        expect(imageData.scaleY).to.equal(-1);
        done();
      },
    });
  });

  it('should not work when it is not scalable', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      scalable: false,

      ready() {
        const imageData = cropper.scaleY(-1).getImageData();

        expect(imageData.scaleY).to.be.undefined;
        done();
      },
    });
  });
});