diff options
Diffstat (limited to 'library/cropperjs/test/specs/options/minCropBoxHeight.spec.js')
-rw-r--r-- | library/cropperjs/test/specs/options/minCropBoxHeight.spec.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js b/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js new file mode 100644 index 000000000..a071c6e83 --- /dev/null +++ b/library/cropperjs/test/specs/options/minCropBoxHeight.spec.js @@ -0,0 +1,27 @@ +describe('minCropBoxHeight (option)', () => { + it('should be `0` by default', () => { + const image = window.createImage(); + const cropper = new Cropper(image); + + expect(cropper.options.minCropBoxHeight).to.equal(0); + }); + + it('should match the given minimum size', (done) => { + const image = window.createImage(); + const minCropBoxHeight = 150; + const cropper = new Cropper(image, { + minCropBoxHeight, + + ready() { + const cropBoxData = cropper.setCropBoxData({ + height: 100, + }).getCropBoxData(); + + expect(cropBoxData.height).to.equal(minCropBoxHeight); + done(); + }, + }); + + expect(cropper.options.minCropBoxHeight).to.equal(minCropBoxHeight); + }); +}); |