diff options
Diffstat (limited to 'library/cropperjs/test/specs/methods/scaleY.spec.js')
-rw-r--r-- | library/cropperjs/test/specs/methods/scaleY.spec.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/library/cropperjs/test/specs/methods/scaleY.spec.js b/library/cropperjs/test/specs/methods/scaleY.spec.js new file mode 100644 index 000000000..f983a2fbf --- /dev/null +++ b/library/cropperjs/test/specs/methods/scaleY.spec.js @@ -0,0 +1,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(); + }, + }); + }); +}); |