mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-08 00:19:29 +02:00
Fixed tests
This commit is contained in:
parent
20582b43c0
commit
c318a0cc59
@ -76,68 +76,6 @@ describe("Phase - Battle Phase", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("wrong phase", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
await game.phaseInterceptor.run(LoginPhase).catch(e => {
|
||||
expect(e).toBe("Wrong phase: this is SelectGenderPhase and not LoginPhase");
|
||||
});
|
||||
});
|
||||
|
||||
it("wrong phase but skip", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
await game.phaseInterceptor.run(LoginPhase, () => game.isCurrentPhase(SelectGenderPhase));
|
||||
});
|
||||
|
||||
it("good run", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
game.onNextPrompt(
|
||||
"SelectGenderPhase",
|
||||
UiMode.OPTION_SELECT,
|
||||
() => {
|
||||
game.scene.gameData.gender = PlayerGender.MALE;
|
||||
game.endPhase();
|
||||
},
|
||||
() => game.isCurrentPhase(TitlePhase),
|
||||
);
|
||||
await game.phaseInterceptor.run(SelectGenderPhase, () => game.isCurrentPhase(TitlePhase));
|
||||
await game.phaseInterceptor.run(TitlePhase);
|
||||
});
|
||||
|
||||
it("good run from select gender to title", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
game.onNextPrompt(
|
||||
"SelectGenderPhase",
|
||||
UiMode.OPTION_SELECT,
|
||||
() => {
|
||||
game.scene.gameData.gender = PlayerGender.MALE;
|
||||
game.endPhase();
|
||||
},
|
||||
() => game.isCurrentPhase(TitlePhase),
|
||||
);
|
||||
await game.phaseInterceptor.runFrom(SelectGenderPhase).to(TitlePhase);
|
||||
});
|
||||
|
||||
it("good run to SummonPhase phase", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
game.onNextPrompt(
|
||||
"SelectGenderPhase",
|
||||
UiMode.OPTION_SELECT,
|
||||
() => {
|
||||
game.scene.gameData.gender = PlayerGender.MALE;
|
||||
game.endPhase();
|
||||
},
|
||||
() => game.isCurrentPhase(TitlePhase),
|
||||
);
|
||||
game.onNextPrompt("TitlePhase", UiMode.TITLE, () => {
|
||||
game.scene.gameMode = getGameMode(GameModes.CLASSIC);
|
||||
const starters = generateStarter(game.scene);
|
||||
const selectStarterPhase = new SelectStarterPhase();
|
||||
game.scene.phaseManager.pushPhase(new EncounterPhase(false));
|
||||
selectStarterPhase.initBattle(starters);
|
||||
});
|
||||
await game.phaseInterceptor.runFrom(SelectGenderPhase).to(SummonPhase);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{ name: "1v1", double: false, qty: 1 },
|
||||
{ name: "2v1", double: false, qty: 2 },
|
||||
|
@ -57,7 +57,7 @@ describe("UI - Type Hints", () => {
|
||||
expect.soft(dragonClawText.color).toBe("#929292");
|
||||
ui.getHandler().processInput(Button.ACTION);
|
||||
});
|
||||
await game.toNextTurn();
|
||||
await game.phaseInterceptor.to("CommandPhase");
|
||||
});
|
||||
|
||||
it("check status move color", async () => {
|
||||
@ -81,7 +81,7 @@ describe("UI - Type Hints", () => {
|
||||
expect.soft(growlText.color).toBe(undefined);
|
||||
ui.getHandler().processInput(Button.ACTION);
|
||||
});
|
||||
await game.toNextTurn();
|
||||
await game.phaseInterceptor.to("CommandPhase");
|
||||
});
|
||||
|
||||
it("should show the proper hint for a move in doubles after one of the enemy pokemon flees", async () => {
|
||||
@ -117,6 +117,6 @@ describe("UI - Type Hints", () => {
|
||||
expect.soft(shadowBallText.color).toBe(undefined);
|
||||
ui.getHandler().processInput(Button.ACTION);
|
||||
});
|
||||
await game.toNextTurn();
|
||||
await game.phaseInterceptor.to("CommandPhase");
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user