Skip to content

Commit

Permalink
skip: fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
happyhj committed Jan 12, 2018
1 parent eba27b2 commit b31d441
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions test/unit/PanoImageRenderer/PanoImageRenderer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,35 +287,31 @@ describe("PanoImageRenderer", function() {
const sourceImg = new Image();
sourceImg.src = "./images/test_cube.jpg";

console.log("before load");
inst = new PanoImageRenderer(sourceImg, 200, 200, false, {
initialYaw: 0,
initialpitch: 0,
imageType: "vertical_cubestrip",
fieldOfView: 65
});

return new Promise(resolve => {
inst = new PanoImageRenderer(sourceImg, 200, 200, false, {
initialYaw: 0,
initialpitch: 0,
imageType: "vertical_cubestrip",
fieldOfView: 65
});
inst.on("imageLoaded", () => {
inst.render(0, 0, 65);
inst._draw = function() {
isDrawCalled = true;
PanoImageRenderer.prototype._draw.call(inst);
};

// When
inst.keepUpdate(false);
inst.render(0, 0, 65);

inst.on("imageLoaded", () => {
console.log("imageLoaded");
inst.render(0, 0, 65);
inst._draw = function() {
isDrawCalled = true;
PanoImageRenderer.prototype._draw.call(inst);
};

// When
inst.keepUpdate(false);
console.log("brfore render");
inst.render(0, 0, 65);

console.log("render");
// Then
// Then
try {
expect(isDrawCalled).to.be.equal(false);
console.log("after assert");
resolve();
});
done();
} catch (error) {
done(error);
}
});
});
});
Expand Down

0 comments on commit b31d441

Please sign in to comment.