Polishing tests

This commit is contained in:
Michael Li 2024-10-12 23:20:02 -04:00
parent 4bd58f9756
commit 4182c1fb8a
2 changed files with 5 additions and 1 deletions

View File

@ -152,7 +152,7 @@ describe("Moves - Dragon Tail", () => {
// Make sure the enemy switched to a healthy Pokemon
const enemy = game.scene.getEnemyPokemon()!;
expect(enemy).toBeDefined();
expect(enemy.isFullHp).toBeTruthy();
expect(enemy.isFullHp()).toBe(true);
// Make sure the enemy has a fainted Pokemon in their party
const faintedEnemy = game.scene.getEnemyParty().find(p => !p.isAllowedInBattle());

View File

@ -103,11 +103,15 @@ describe("Moves - U-turn", () => {
Species.RAICHU,
Species.SHUCKLE
]);
const enemy = game.scene.getEnemyPokemon()!;
// KO the opponent with U-Turn
game.move.select(Moves.U_TURN);
game.doSelectPartyPokemon(1);
await game.phaseInterceptor.to(TurnEndPhase);
expect(enemy.isFainted()).toBe(true);
// Check that U-Turn forced a switch
expect(game.phaseInterceptor.log).toContain("SwitchSummonPhase");
expect(game.scene.getPlayerPokemon()!.species.speciesId).toBe(Species.SHUCKLE);
});