[Unittest] Prevent Arena Trap/etc from breaking Costar test (#2923)

This commit is contained in:
NightKev 2024-07-08 13:37:22 -07:00 committed by GitHub
parent f9327680dd
commit 458245f542
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -29,7 +29,7 @@ describe("Abilities - COSTAR", () => {
game = new GameManager(phaserGame);
vi.spyOn(Overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COSTAR);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT, Moves.CURSE]);
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT]);
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
});
@ -37,15 +37,17 @@ describe("Abilities - COSTAR", () => {
test(
"ability copies positive stat changes",
async () => {
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
expect(leftPokemon).not.toBe(undefined);
expect(rightPokemon).not.toBe(undefined);
expect(leftPokemon).toBeDefined();
expect(rightPokemon).toBeDefined();
game.doAttack(getMovePosition(game.scene, 0, Moves.NASTY_PLOT));
await game.phaseInterceptor.to(CommandPhase);
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
game.doAttack(getMovePosition(game.scene, 1, Moves.SPLASH));
await game.toNextTurn();
expect(leftPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2);
@ -71,8 +73,8 @@ describe("Abilities - COSTAR", () => {
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
expect(leftPokemon).not.toBe(undefined);
expect(rightPokemon).not.toBe(undefined);
expect(leftPokemon).toBeDefined();
expect(rightPokemon).toBeDefined();
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);