Skip to content

Commit

Permalink
test(YawPitchControl): add test for updatePanScale after fov change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jongmoon Yoon committed May 11, 2018
1 parent 32e9643 commit 0c2568c
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/unit/YawPitchControl/YawPitchControl.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,41 @@ describe("YawPitchControl", function() {
});

});

describe("fovRange Test", () => {
let yawpitch;
let target;

beforeEach(() => {
target = sandbox();
target.innerHTML = `<div style="width:300px;height:300px;"></div>`;

yawpitch = new YawPitchControl({element: target});
});

afterEach(() => {
cleanup();
yawpitch.destroy();
});

it("should update panScale if fov is changed by fovRange's change", () => {
// Given
const prevFov = yawpitch.getFov();
const prevPanScale = yawpitch.axesPanInput.options.scale;

// When
yawpitch.option("fovRange", [prevFov + 10, prevFov + 30]);

// Then
const currFov = yawpitch.getFov();
const currPanScale = yawpitch.axesPanInput.options.scale;

console.log(prevFov, currFov, prevPanScale, currPanScale);

expect(currFov).to.not.equal(prevFov);
expect(prevPanScale).to.not.equal(currPanScale);
});
});
});

describe("Pitch adjustment", function() {
Expand Down

0 comments on commit 0c2568c

Please sign in to comment.