aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/options/modal.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'library/cropperjs/test/specs/options/modal.spec.js')
-rw-r--r--library/cropperjs/test/specs/options/modal.spec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/library/cropperjs/test/specs/options/modal.spec.js b/library/cropperjs/test/specs/options/modal.spec.js
new file mode 100644
index 000000000..e82fbed82
--- /dev/null
+++ b/library/cropperjs/test/specs/options/modal.spec.js
@@ -0,0 +1,27 @@
+describe('modal (option)', () => {
+ it('should show the modal by default', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ ready() {
+ expect(cropper.dragBox.className).to.include('cropper-modal');
+ done();
+ },
+ });
+
+ expect(cropper.options.modal).to.be.true;
+ });
+
+ it('should not show the modal', (done) => {
+ const image = window.createImage();
+ const cropper = new Cropper(image, {
+ modal: false,
+
+ ready() {
+ expect(cropper.dragBox.className).to.not.include('cropper-modal');
+ done();
+ },
+ });
+
+ expect(cropper.options.modal).to.be.false;
+ });
+});