1
0
Fork 0
spacetac/src/ui/character/CharacterSheet.spec.ts

30 lines
907 B
TypeScript

module TS.SpaceTac.UI.Specs {
describe("CharacterSheet", function () {
let testgame = setupEmptyView();
it("displays fleet and ship information", function () {
let view = testgame.baseview;
let sheet = new CharacterSheet(view, -1000);
expect(sheet.x).toEqual(-1000);
let fleet = new Fleet();
let ship1 = fleet.addShip();
ship1.name = "Ship 1";
let ship2 = fleet.addShip();
ship2.name = "Ship 2";
sheet.show(ship1, false);
expect(sheet.x).toEqual(0);
expect(sheet.portraits.length).toBe(2);
expect(sheet.ship_name.text).toEqual("Ship 1");
let portrait = <Phaser.Button>sheet.portraits.getChildAt(1);
portrait.onInputUp.dispatch();
expect(sheet.ship_name.text).toEqual("Ship 2");
});
});
}