mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-04 08:58:08 +00:00
* Modify tests to use overrides helper functions * Apply stylistic consistency to overrides in tests Also remove some non-test-related expects()
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
import Phaser from "phaser";
|
|
import GameManager from "#test/utils/gameManager";
|
|
import { TurnStartPhase } from "#app/phases";
|
|
import { getMovePosition } from "#test/utils/gameManagerUtils";
|
|
import { StatusEffect } from "#app/data/status-effect";
|
|
import { Species } from "#enums/species";
|
|
import { Moves } from "#enums/moves";
|
|
|
|
describe("Moves - Fusion Flare", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
const fusionFlare = Moves.FUSION_FLARE;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override.moveset([ fusionFlare ]);
|
|
game.override.startingLevel(1);
|
|
|
|
game.override.enemySpecies(Species.RESHIRAM);
|
|
game.override.enemyMoveset([ Moves.REST, Moves.REST, Moves.REST, Moves.REST ]);
|
|
|
|
game.override.battleType("single");
|
|
game.override.startingWave(97);
|
|
game.override.disableCrits();
|
|
});
|
|
|
|
it("should thaw freeze status condition", async() => {
|
|
await game.startBattle([
|
|
Species.RESHIRAM,
|
|
]);
|
|
|
|
const partyMember = game.scene.getPlayerPokemon();
|
|
|
|
game.doAttack(getMovePosition(game.scene, 0, fusionFlare));
|
|
|
|
await game.phaseInterceptor.to(TurnStartPhase, false);
|
|
|
|
// Inflict freeze quietly and check if it was properly inflicted
|
|
partyMember.trySetStatus(StatusEffect.FREEZE, false);
|
|
expect(partyMember.status.effect).toBe(StatusEffect.FREEZE);
|
|
|
|
await game.toNextTurn();
|
|
|
|
// Check if FUSION_FLARE thawed freeze
|
|
expect(partyMember.status?.effect).toBeUndefined();
|
|
});
|
|
});
|