2017-01-11 17:31:21 +00:00
|
|
|
/// <reference path="../TestGame.ts"/>
|
2015-04-26 17:15:45 +00:00
|
|
|
|
2017-02-09 00:00:35 +00:00
|
|
|
module TS.SpaceTac.UI.Specs {
|
2017-02-21 22:38:31 +00:00
|
|
|
describe("ShipList", function () {
|
|
|
|
let testgame = setupBattleview();
|
|
|
|
|
|
|
|
it("handles play position of ships", function () {
|
|
|
|
let battleview = testgame.battleview;
|
2015-04-26 17:15:45 +00:00
|
|
|
var list = battleview.ship_list;
|
|
|
|
|
2017-05-02 22:49:35 +00:00
|
|
|
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
|
|
|
|
2015-04-26 17:15:45 +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();
|
2015-04-26 17:15:45 +00:00
|
|
|
battleview.battle.advanceToNextShip();
|
|
|
|
|
2017-05-02 22:49:35 +00:00
|
|
|
expect(list.findPlayPosition(battleview.battle.play_order[0])).toBe(9);
|
2015-04-26 17:15:45 +00:00
|
|
|
expect(list.findPlayPosition(battleview.battle.play_order[1])).toBe(0);
|
|
|
|
expect(list.findPlayPosition(battleview.battle.play_order[2])).toBe(1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|