Update tests

This commit is contained in:
NightKev 2024-09-04 03:10:26 -07:00
parent db6c74010a
commit 5679aa45dc

View File

@ -1,12 +1,11 @@
import { SPLASH_ONLY } from "../utils/testUtils";
import { BerryPhase, TurnInitPhase } from "#app/phases";
import { WeatherType } from "#enums/weather-type";
import { Abilities } from "#app/enums/abilities";
import { Moves } from "#enums/moves";
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 { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
import GameManager from "../utils/gameManager";
import { getMovePosition } from "../utils/gameManagerUtils";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
const TIMEOUT = 20 * 1000;
@ -27,43 +26,35 @@ describe("Moves - Chilly Reception", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
game.override.battleType("single")
.moveset([Moves.CHILLY_RECEPTION, Moves.SPLASH, Moves.SNOWSCAPE])
.moveset([Moves.CHILLY_RECEPTION, Moves.SNOWSCAPE])
.enemyMoveset(SPLASH_ONLY)
.startingLevel(5)
.enemyLevel(5);
.enemyAbility(Abilities.BALL_FETCH)
.ability(Abilities.BALL_FETCH);
});
test(
"Chilly reception should still change the weather if user can't switch out",
async () => {
await game.startBattle([Species.SLOWKING]);
it("should still change the weather if user can't switch out", async () => {
await game.classicMode.startBattle([Species.SLOWKING]);
const enemyPokemon = game.scene.getEnemyPokemon()!;
expect(enemyPokemon).toBeDefined();
game.doAttack(getMovePosition(game.scene, 0, Moves.CHILLY_RECEPTION));
game.move.select(Moves.CHILLY_RECEPTION);
await game.phaseInterceptor.to(BerryPhase, false);
await game.phaseInterceptor.to("BerryPhase", false);
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
}, TIMEOUT
);
}, TIMEOUT);
test(
"Chilly reception should switch out even if it's snowing",
async () => {
await game.startBattle([Species.SLOWKING, Species.MEOWTH]);
it("should switch out even if it's snowing", async () => {
await game.classicMode.startBattle([Species.SLOWKING, Species.MEOWTH]);
// first turn set up snow with snowscape, try chilly reception on second turn
game.doAttack(getMovePosition(game.scene, 0, Moves.SNOWSCAPE));
await game.phaseInterceptor.to(BerryPhase, false);
game.move.select(Moves.SNOWSCAPE);
await game.phaseInterceptor.to("BerryPhase", false);
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SNOW);
await game.phaseInterceptor.to(TurnInitPhase, false);
game.doAttack(getMovePosition(game.scene, 0, Moves.CHILLY_RECEPTION));
await game.phaseInterceptor.to("TurnInitPhase", false);
game.move.select(Moves.CHILLY_RECEPTION);
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.getPlayerField()[0].species.speciesId).toBe(Species.MEOWTH);
}, TIMEOUT
);
}, TIMEOUT);
});