From 112963637a58317235c9cc670f9d530d569082b3 Mon Sep 17 00:00:00 2001 From: Bertie690 <136088738+Bertie690@users.noreply.github.com> Date: Wed, 8 Oct 2025 00:42:27 -0400 Subject: [PATCH] [Test] Improved liquid ooze test file to use updated test utils (#6633) --- test/abilities/liquid-ooze.test.ts | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/test/abilities/liquid-ooze.test.ts b/test/abilities/liquid-ooze.test.ts index 1d04ac5389a..008d4bf4b7f 100644 --- a/test/abilities/liquid-ooze.test.ts +++ b/test/abilities/liquid-ooze.test.ts @@ -5,7 +5,7 @@ import { GameManager } from "#test/test-utils/game-manager"; import Phaser from "phaser"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; -describe("Abilities - Liquid Ooze", () => { +describe("Ability - Liquid Ooze", () => { let phaserGame: Phaser.Game; let game: GameManager; @@ -22,7 +22,6 @@ describe("Abilities - Liquid Ooze", () => { beforeEach(() => { game = new GameManager(phaserGame); game.override - .moveset([MoveId.SPLASH, MoveId.GIGA_DRAIN]) .ability(AbilityId.BALL_FETCH) .battleStyle("single") .enemyLevel(20) @@ -31,32 +30,40 @@ describe("Abilities - Liquid Ooze", () => { .enemyMoveset(MoveId.SPLASH); }); - it("should drain the attacker's HP after a draining move", async () => { + it("should reverse the effect of HP-draining moves", async () => { await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.GIGA_DRAIN); - await game.phaseInterceptor.to("BerryPhase"); + game.move.use(MoveId.GIGA_DRAIN); + await game.toEndOfTurn(); - expect(game.field.getPlayerPokemon()).not.toHaveFullHp(); + const karp = game.field.getEnemyPokemon(); + expect(karp).toHaveAbilityApplied(AbilityId.LIQUID_OOZE); + expect(karp).not.toHaveFullHp(); + const feebas = game.field.getPlayerPokemon(); + expect(feebas).toHaveTakenDamage(karp.getInverseHp() / 2); }); it("should not drain the attacker's HP if it ignores indirect damage", async () => { game.override.ability(AbilityId.MAGIC_GUARD); await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.GIGA_DRAIN); - await game.phaseInterceptor.to("BerryPhase"); + game.move.use(MoveId.GIGA_DRAIN); + await game.toEndOfTurn(); expect(game.field.getPlayerPokemon()).toHaveFullHp(); }); + // Regression test it("should not apply if suppressed", async () => { game.override.ability(AbilityId.NEUTRALIZING_GAS); await game.classicMode.startBattle([SpeciesId.FEEBAS]); - game.move.select(MoveId.GIGA_DRAIN); - await game.phaseInterceptor.to("BerryPhase"); + game.move.use(MoveId.GIGA_DRAIN); + await game.toEndOfTurn(); expect(game.field.getPlayerPokemon()).toHaveFullHp(); }); + + // TODO: Write test + it.todo("should reverse drains from Leech Seed"); });