username@email.com
2025-04-27 15eb82df2d6ec539e9d4245bfe08d531e8eb6379
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
29
30
31
32
33
34
describe('ready (option)', () => {
  it('should be null be default', () => {
    const image = window.createImage();
    const viewer = new Viewer(image);
 
    expect(viewer.options.ready).to.be.null;
  });
 
  it('should execute the `ready` hook function', (done) => {
    const image = window.createImage();
    const viewer = new Viewer(image, {
      ready(event) {
        expect(event.type).to.equal('ready');
        event.preventDefault();
        done();
      },
    });
 
    viewer.show();
  });
 
  it('should execute the `ready` hook function in inline mode', (done) => {
    const image = window.createImage();
 
    new Viewer(image, {
      inline: true,
 
      ready(event) {
        expect(event.type).to.equal('ready');
        done();
      },
    });
  });
});