1
0
Fork 0
spacetac/src/ui/map/FleetDisplay.spec.ts

22 lines
821 B
TypeScript
Raw Normal View History

2017-02-09 00:00:35 +00:00
module TS.SpaceTac.UI.Specs {
2017-02-21 22:38:31 +00:00
describe("FleetDisplay", function () {
let testgame = setupMapview();
it("orbits the fleet around its current location", function () {
let mapview = testgame.mapview;
2017-01-30 00:40:33 +00:00
let fleet = mapview.player_fleet;
fleet.loopOrbit();
expect(fleet.rotation).toBe(0);
mapview.game.tweens.update();
let tween = first(mapview.game.tweens.getAll(), tw => tw.target == fleet);
let tweendata = tween.generateData(0.1);
expect(tweendata.length).toEqual(3);
expect(tweendata[0].rotation).toBeCloseTo(-Math.PI * 2 / 3);
expect(tweendata[1].rotation).toBeCloseTo(-Math.PI * 4 / 3);
expect(tweendata[2].rotation).toBeCloseTo(-Math.PI * 2);
});
});
}