aboutsummaryrefslogblamecommitdiffstats
path: root/library/cropperjs/test/specs/options/background.spec.js
blob: d1f9866e22b54cf138dd3b7823a1248a9acc026f (plain) (tree)


























                                                                                              
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;
  });
});