<commit_before>describe('wheelZoomRatio (option)', () => {
  it('should be `0.1` by default', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      ready() {
        const canvasData = cropper.getCanvasData();
        const wheelEvent = window.createEvent('wheel');

        wheelEvent.deltaY = -1;
        cropper.cropper.dispatchEvent(wheelEvent);
        expect(canvasData.width * 1.1).to.equal(cropper.getCanvasData().width);
        done();
      },
    });

    expect(cropper.options.wheelZoomRatio).to.equal(0.1);
  });

  it('should match the given zoom ratio', (done) => {
    const image = window.createImage();
    const wheelZoomRatio = 0.2;
    const cropper = new Cropper(image, {
      wheelZoomRatio,

      ready() {
        const canvasData = cropper.getCanvasData();
        const wheelEvent = window.createEvent('wheel');

        wheelEvent.deltaY = -1;
        cropper.cropper.dispatchEvent(wheelEvent);
        const expectedWidthRaw = canvasData.width * (1 + wheelZoomRatio);
        const actualWidthRaw = cropper.getCanvasData().width;

        const expectedWidth = Math.round(expectedWidthRaw * 10) / 10;
        const actualWidth = Math.round(actualWidthRaw * 10) / 10;

        expect(expectedWidth).to.equal(actualWidth);
        done();
      },
    });

    expect(cropper.options.wheelZoomRatio).to.equal(wheelZoomRatio);
  });
});
<commit_msg>test: improve test cases for `wheelZoomRatio`<commit_after>describe('wheelZoomRatio (option)', () => {
  it('should be `0.1` by default', (done) => {
    const image = window.createImage();
    const cropper = new Cropper(image, {
      ready() {
        const canvasData = cropper.getCanvasData();
        const wheelEvent = window.createEvent('wheel');

        wheelEvent.deltaY = -1;
        cropper.cropper.dispatchEvent(wheelEvent);

        const expectedCanvasWidth = canvasData.width * 1.1;
        const actualCanvasWidth = cropper.getCanvasData().width;

        expect(Math.round(expectedCanvasWidth)).to.equal(Math.round(actualCanvasWidth));
        done();
      },
    });

    expect(cropper.options.wheelZoomRatio).to.equal(0.1);
  });

  it('should match the given zoom ratio', (done) => {
    const image = window.createImage();
    const wheelZoomRatio = 0.2;
    const cropper = new Cropper(image, {
      wheelZoomRatio,

      ready() {
        const canvasData = cropper.getCanvasData();
        const wheelEvent = window.createEvent('wheel');

        wheelEvent.deltaY = -1;
        cropper.cropper.dispatchEvent(wheelEvent);

        const expectedCanvasWidth = canvasData.width * (1 + wheelZoomRatio);
        const actualCanvasWidth = cropper.getCanvasData().width;

        expect(Math.round(expectedCanvasWidth)).to.equal(Math.round(actualCanvasWidth));
        done();
      },
    });

    expect(cropper.options.wheelZoomRatio).to.equal(wheelZoomRatio);
  });
});

{'fraction_non_alphanumeric': 0.13655030800821355, 'fraction_numerical': 0.01026694045174538, 'mean_word_length': 2.9714673913043477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3618893', 'n_tokens_mistral': 884, 'n_tokens_neox': 838, 'n_words': 157}