mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-17 07:15:22 +01:00
[Test] Improved liquid ooze test file to use updated test utils (#6633)
This commit is contained in:
parent
15b6877a86
commit
112963637a
@ -5,7 +5,7 @@ import { GameManager } from "#test/test-utils/game-manager";
|
|||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("Abilities - Liquid Ooze", () => {
|
describe("Ability - Liquid Ooze", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
|
|
||||||
@ -22,7 +22,6 @@ describe("Abilities - Liquid Ooze", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([MoveId.SPLASH, MoveId.GIGA_DRAIN])
|
|
||||||
.ability(AbilityId.BALL_FETCH)
|
.ability(AbilityId.BALL_FETCH)
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.enemyLevel(20)
|
.enemyLevel(20)
|
||||||
@ -31,32 +30,40 @@ describe("Abilities - Liquid Ooze", () => {
|
|||||||
.enemyMoveset(MoveId.SPLASH);
|
.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]);
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.GIGA_DRAIN);
|
game.move.use(MoveId.GIGA_DRAIN);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
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 () => {
|
it("should not drain the attacker's HP if it ignores indirect damage", async () => {
|
||||||
game.override.ability(AbilityId.MAGIC_GUARD);
|
game.override.ability(AbilityId.MAGIC_GUARD);
|
||||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.GIGA_DRAIN);
|
game.move.use(MoveId.GIGA_DRAIN);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
expect(game.field.getPlayerPokemon()).toHaveFullHp();
|
expect(game.field.getPlayerPokemon()).toHaveFullHp();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Regression test
|
||||||
it("should not apply if suppressed", async () => {
|
it("should not apply if suppressed", async () => {
|
||||||
game.override.ability(AbilityId.NEUTRALIZING_GAS);
|
game.override.ability(AbilityId.NEUTRALIZING_GAS);
|
||||||
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.GIGA_DRAIN);
|
game.move.use(MoveId.GIGA_DRAIN);
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
expect(game.field.getPlayerPokemon()).toHaveFullHp();
|
expect(game.field.getPlayerPokemon()).toHaveFullHp();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: Write test
|
||||||
|
it.todo("should reverse drains from Leech Seed");
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user