From d6c5f0d514a1c85a011997c20084ef42e9f01882 Mon Sep 17 00:00:00 2001 From: Bertie690 Date: Tue, 3 Jun 2025 17:50:03 -0400 Subject: [PATCH] Revert safeguart etst --- test/moves/safeguard.test.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/moves/safeguard.test.ts b/test/moves/safeguard.test.ts index 8f8276aa603..85067aa06a8 100644 --- a/test/moves/safeguard.test.ts +++ b/test/moves/safeguard.test.ts @@ -134,10 +134,15 @@ describe("Moves - Safeguard", () => { }); it("protects from ability-inflicted status", async () => { - game.override.ability(Abilities.STATIC); - vi.spyOn(PostDefendContactApplyStatusEffectAbAttr.prototype, "chance", "get").mockReturnValue(100); await game.classicMode.startBattle(); - const enemyPokemon = game.scene.getEnemyPokemon()!; + + const player = game.field.getPlayerPokemon(); + game.field.mockAbility(player, Abilities.STATIC); + vi.spyOn( + player.getAbility().getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0], + "chance", + "get", + ).mockReturnValue(100); game.move.select(Moves.SPLASH); await game.move.forceEnemyMove(Moves.SAFEGUARD); @@ -147,6 +152,7 @@ describe("Moves - Safeguard", () => { await game.move.forceEnemyMove(Moves.TACKLE); await game.toNextTurn(); + const enemyPokemon = game.field.getEnemyPokemon(); expect(enemyPokemon.status).toBeUndefined(); }); });