From 89b33466a9b6e6dbf3169bbc490c411291e23485 Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Mon, 9 Sep 2024 09:53:45 -0700 Subject: [PATCH] [Test] Fix Safeguard test that relied on a now-fixed bug (#4098) --- src/test/moves/safeguard.test.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/moves/safeguard.test.ts b/src/test/moves/safeguard.test.ts index 94a7aa6031e..8068c475539 100644 --- a/src/test/moves/safeguard.test.ts +++ b/src/test/moves/safeguard.test.ts @@ -38,7 +38,7 @@ describe("Moves - Safeguard", () => { }); it("protects from damaging moves with additional effects", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const enemy = game.scene.getEnemyPokemon()!; game.move.select(Moves.NUZZLE); @@ -49,7 +49,7 @@ describe("Moves - Safeguard", () => { }, TIMEOUT); it("protects from status moves", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.SPORE); @@ -61,7 +61,7 @@ describe("Moves - Safeguard", () => { it("protects from confusion", async () => { game.override.moveset([Moves.CONFUSE_RAY]); - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.CONFUSE_RAY); @@ -74,7 +74,7 @@ describe("Moves - Safeguard", () => { it("protects ally from status", async () => { game.override.battleType("double"); - await game.startBattle(); + await game.classicMode.startBattle(); game.move.select(Moves.SPORE, 0, BattlerIndex.ENEMY_2); game.move.select(Moves.NUZZLE, 1, BattlerIndex.ENEMY_2); @@ -90,7 +90,7 @@ describe("Moves - Safeguard", () => { }, TIMEOUT); it("protects from Yawn", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.YAWN); @@ -101,7 +101,7 @@ describe("Moves - Safeguard", () => { }, TIMEOUT); it("doesn't protect from already existing Yawn", async () => { - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.YAWN); @@ -116,12 +116,13 @@ describe("Moves - Safeguard", () => { it("doesn't protect from self-inflicted via Rest or Flame Orb", async () => { game.override.enemyHeldItems([{name: "FLAME_ORB"}]); - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.SPLASH); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.toNextTurn(); + enemyPokemon.damageAndUpdate(1); expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN); @@ -135,7 +136,7 @@ describe("Moves - Safeguard", () => { it("protects from ability-inflicted status", async () => { game.override.ability(Abilities.STATIC); vi.spyOn(allAbilities[Abilities.STATIC].getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0], "chance", "get").mockReturnValue(100); - await game.startBattle(); + await game.classicMode.startBattle(); const enemyPokemon = game.scene.getEnemyPokemon()!; game.move.select(Moves.SPLASH);