1
0
Fork 0
spacetac/src/ui/battle/ShipList.spec.ts

27 lines
1 KiB
TypeScript
Raw Normal View History

/// <reference path="../TestGame.ts"/>
2017-09-24 22:23:22 +00:00
module TK.SpaceTac.UI.Specs {
2017-02-21 22:38:31 +00:00
describe("ShipList", function () {
let testgame = setupBattleview();
it("handles play position of ships", function () {
2017-10-09 21:13:56 +00:00
let battleview = testgame.view;
var list = battleview.ship_list;
expect(battleview.battle.play_order.length).toBe(10);
2017-05-14 21:03:03 +00:00
expect(list.children.length).toBe(11);
2017-02-16 22:59:41 +00:00
expect(list.findPlayPosition(battleview.battle.play_order[0])).toBe(0);
expect(list.findPlayPosition(battleview.battle.play_order[1])).toBe(1);
expect(list.findPlayPosition(battleview.battle.play_order[2])).toBe(2);
2017-02-16 22:59:41 +00:00
spyOn(battleview.battle, "playAI").and.stub();
battleview.battle.advanceToNextShip();
expect(list.findPlayPosition(battleview.battle.play_order[0])).toBe(9);
expect(list.findPlayPosition(battleview.battle.play_order[1])).toBe(0);
expect(list.findPlayPosition(battleview.battle.play_order[2])).toBe(1);
});
});
}