2017-05-02 22:49:35 +00:00
|
|
|
/// <reference path="../TestGame.ts" />
|
2017-02-10 00:08:28 +00:00
|
|
|
/// <reference path="MainMenu.ts" />
|
|
|
|
|
2017-09-24 22:23:22 +00:00
|
|
|
module TK.SpaceTac.UI.Specs {
|
2017-10-26 21:47:13 +00:00
|
|
|
testing("MainMenu", test => {
|
2017-10-29 21:08:55 +00:00
|
|
|
let testgame = setupSingleView(test, () => [new MainMenu(), []]);
|
2017-02-21 22:38:31 +00:00
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
test.case("adds moving stars, a title and three buttons", check => {
|
2017-02-21 22:38:31 +00:00
|
|
|
let view = <MainMenu>testgame.ui.state.getCurrentState();
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
check.equals(view.layer_stars.children.length, 300);
|
|
|
|
check.equals(view.layer_title.children.length, 6);
|
|
|
|
check.equals(view.layer_title.children[0] instanceof Phaser.Button, true);
|
|
|
|
check.equals(view.layer_title.children[1] instanceof Phaser.Button, true);
|
|
|
|
check.equals(view.layer_title.children[2] instanceof Phaser.Button, true);
|
|
|
|
check.equals(view.layer_title.children[3] instanceof Phaser.Image, true);
|
2017-02-10 00:08:28 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|