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
29
30
31
32
33
34
35
36
37
38
describe('rotate (method)', () => {
  it('should rotate to the expected degrees', (done) => {
    const image = window.createImage();
    const viewer = new Viewer(image, {
      inline: true,
 
      viewed() {
        const { imageData } = viewer;
 
        expect(imageData.rotate).to.equal(0);
        viewer.rotate(90);
        expect(imageData.rotate).to.equal(90);
        viewer.rotate(90);
        expect(imageData.rotate).to.equal(180);
        viewer.rotate(-180);
        expect(imageData.rotate).to.equal(0);
        done();
      },
    });
  });
 
  it('should not work when it is not rotatable', (done) => {
    const image = window.createImage();
    const viewer = new Viewer(image, {
      inline: true,
      rotatable: false,
 
      viewed() {
        const { imageData } = viewer;
 
        expect(imageData.rotate).to.be.undefined;
        viewer.rotate(90);
        expect(imageData.rotate).to.be.undefined;
        done();
      },
    });
  });
});