mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-12 19:32:17 +02:00
Update tests
This commit is contained in:
parent
db6c74010a
commit
5679aa45dc
@ -1,12 +1,11 @@
|
|||||||
import { SPLASH_ONLY } from "../utils/testUtils";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import { BerryPhase, TurnInitPhase } from "#app/phases";
|
|
||||||
import { WeatherType } from "#enums/weather-type";
|
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
import { WeatherType } from "#enums/weather-type";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import { SPLASH_ONLY } from "#test/utils/testUtils";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import GameManager from "../utils/gameManager";
|
|
||||||
import { getMovePosition } from "../utils/gameManagerUtils";
|
|
||||||
|
|
||||||
const TIMEOUT = 20 * 1000;
|
const TIMEOUT = 20 * 1000;
|
||||||
|
|
||||||
@ -27,43 +26,35 @@ describe("Moves - Chilly Reception", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single")
|
game.override.battleType("single")
|
||||||
.moveset([Moves.CHILLY_RECEPTION, Moves.SPLASH, Moves.SNOWSCAPE])
|
.moveset([Moves.CHILLY_RECEPTION, Moves.SNOWSCAPE])
|
||||||
.enemyMoveset(SPLASH_ONLY)
|
.enemyMoveset(SPLASH_ONLY)
|
||||||
.startingLevel(5)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemyLevel(5);
|
.ability(Abilities.BALL_FETCH);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test(
|
it("should still change the weather if user can't switch out", async () => {
|
||||||
"Chilly reception should still change the weather if user can't switch out",
|
await game.classicMode.startBattle([Species.SLOWKING]);
|
||||||
async () => {
|
|
||||||
await game.startBattle([Species.SLOWKING]);
|
|
||||||
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
game.move.select(Moves.CHILLY_RECEPTION);
|
||||||
expect(enemyPokemon).toBeDefined();
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CHILLY_RECEPTION));
|
|
||||||
|
|
||||||
await game.phaseInterceptor.to(BerryPhase, false);
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
||||||
}, TIMEOUT
|
}, TIMEOUT);
|
||||||
);
|
|
||||||
|
|
||||||
test(
|
it("should switch out even if it's snowing", async () => {
|
||||||
"Chilly reception should switch out even if it's snowing",
|
await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]);
|
||||||
async () => {
|
// first turn set up snow with snowscape, try chilly reception on second turn
|
||||||
await game.startBattle([Species.SLOWKING, Species.MEOWTH]);
|
game.move.select(Moves.SNOWSCAPE);
|
||||||
// first turn set up snow with snowscape, try chilly reception on second turn
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SNOWSCAPE));
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
||||||
await game.phaseInterceptor.to(BerryPhase, false);
|
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnInitPhase, false);
|
await game.phaseInterceptor.to("TurnInitPhase", false);
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.CHILLY_RECEPTION));
|
game.move.select(Moves.CHILLY_RECEPTION);
|
||||||
game.doSelectPartyPokemon(1);
|
game.doSelectPartyPokemon(1);
|
||||||
|
|
||||||
await game.phaseInterceptor.to(BerryPhase, false);
|
await game.phaseInterceptor.to("BerryPhase", false);
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
|
||||||
expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH);
|
expect(game.scene.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH);
|
||||||
}, TIMEOUT
|
}, TIMEOUT);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user