aboutsummaryrefslogtreecommitdiffstats
path: root/library/cropperjs/test/specs/options/background.spec.js
blob: d1f9866e22b54cf138dd3b7823a1248a9acc026f (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('background (option)', () => {
  it('should show the background by default', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      ready() {
        expect(window.getComputedStyle(cropper.cropper).backgroundImage).to.not.equal('none');
        done();
      },
    });

    expect(cropper.options.background).to.be.true;
  });

  it('should not show the background', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      background: false,

      ready() {
        expect(window.getComputedStyle(cropper.cropper).backgroundImage).to.equal('none');
        done();
      },
    });

    expect(cropper.options.background).to.be.false;
  });
});