username@email.com
2021-06-03 904fb460b9359fe92e00ce25804d96c8a52bb513
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
28
describe('setDefaults', () => {
  it('should be a static method', () => {
    expect(Viewer.setDefaults).to.be.a('function');
  });
 
  it('should change the global default options', (done) => {
    Viewer.setDefaults({
      backdrop: false,
    });
 
    const image = window.createImage();
    const viewer = new Viewer(image, {
      shown() {
        expect(viewer.viewer.className).to.not.include('viewer-backdrop');
        viewer.hide(true);
        done();
      },
    });
 
    expect(viewer.options.backdrop).to.be.false;
    viewer.show();
 
    // Reverts it for the rest test suites
    Viewer.setDefaults({
      backdrop: true,
    });
  });
});