From f645c6f3a57bf5f53bbb2bde362b2447f725c977 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 11 Jan 2020 10:30:12 +0000 Subject: update cropperjs to the recent version --- .../test/specs/options/minContainerWidth.spec.js | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 library/cropperjs/test/specs/options/minContainerWidth.spec.js (limited to 'library/cropperjs/test/specs/options/minContainerWidth.spec.js') diff --git a/library/cropperjs/test/specs/options/minContainerWidth.spec.js b/library/cropperjs/test/specs/options/minContainerWidth.spec.js new file mode 100644 index 000000000..aabbb5e97 --- /dev/null +++ b/library/cropperjs/test/specs/options/minContainerWidth.spec.js @@ -0,0 +1,26 @@ +describe('minContainerWidth (option)', () => { + it('should be `200` by default', () => { + const image = window.createImage(); + const cropper = new Cropper(image); + + expect(cropper.options.minContainerWidth).to.equal(200); + }); + + it('should match the given minimum size', (done) => { + const image = window.createImage(); + + image.parentElement.style.width = '160px'; + + const minContainerWidth = 320; + const cropper = new Cropper(image, { + minContainerWidth, + + ready() { + expect(cropper.getContainerData().width).to.equal(minContainerWidth); + done(); + }, + }); + + expect(cropper.options.minContainerWidth).to.equal(minContainerWidth); + }); +}); -- cgit v1.2.3