[Test] Improved liquid ooze test file to use updated test utils (#6633)

This commit is contained in:
Bertie690 2025-10-08 00:42:27 -04:00 committed by GitHub
parent 15b6877a86
commit 112963637a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");
});