aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/options/modal.spec.js
blob: e82fbed82b282c6d95c22dfc3864dba6e897845c (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('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;
  });
});