mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-29 13:02:46 +02:00
[Test] Remove unneeded mockRestore
and testTimeout
calls in tests
https://github.com/pagefaultgames/pokerogue/pull/5927/ * Removed unnecessary test timeout parameters from test files We set it in vitest config anyways * Removed unneeded `mockRestore` calls We call `restoreAllMocks` after each test runs anyhow * Removed accidentall forgotten-about timeout * Revdrt magic bounce test file for now * Fixed ting * Fixed bug * Fixed import * Update test/data/status_effect.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Update battle.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Ran bim --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
061c987265
commit
0918985a63
@ -50,5 +50,5 @@ describe("Ability Timing", () => {
|
||||
|
||||
await game.phaseInterceptor.to("MessagePhase");
|
||||
expect(i18next.t).toHaveBeenCalledWith("battle:statFell", expect.objectContaining({ count: 1 }));
|
||||
}, 5000);
|
||||
});
|
||||
});
|
||||
|
@ -47,7 +47,7 @@ describe("Abilities - Beast Boost", () => {
|
||||
await game.phaseInterceptor.to("VictoryPhase");
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.DEF)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should use in-battle overriden stats when determining the stat stage to raise by 1", async () => {
|
||||
game.override.enemyMoveset([MoveId.GUARD_SPLIT]);
|
||||
@ -66,7 +66,7 @@ describe("Abilities - Beast Boost", () => {
|
||||
await game.phaseInterceptor.to("VictoryPhase");
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should have order preference in case of stat ties", async () => {
|
||||
// Order preference follows the order of EFFECTIVE_STAT
|
||||
@ -84,5 +84,5 @@ describe("Abilities - Beast Boost", () => {
|
||||
await game.phaseInterceptor.to("VictoryPhase");
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -36,7 +36,7 @@ describe("Abilities - Contrary", () => {
|
||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
describe("With Clear Body", () => {
|
||||
it("should apply positive effects", async () => {
|
||||
|
@ -44,7 +44,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
game.move.select(MoveId.SPLASH);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(blissey.hp).toBe(blissey.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("not activate if the Pokémon is protected from the Fire-type move", async () => {
|
||||
game.override.enemyMoveset([MoveId.EMBER]).moveset([MoveId.PROTECT]);
|
||||
@ -55,7 +55,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
game.move.select(MoveId.PROTECT);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(blissey!.getTag(BattlerTagType.FIRE_BOOST)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("activated by Will-O-Wisp", async () => {
|
||||
game.override.enemyMoveset([MoveId.WILL_O_WISP]).moveset(MoveId.SPLASH);
|
||||
@ -70,7 +70,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(blissey!.getTag(BattlerTagType.FIRE_BOOST)).toBeDefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("activated after being frozen", async () => {
|
||||
game.override.enemyMoveset([MoveId.EMBER]).moveset(MoveId.SPLASH).statusEffect(StatusEffect.FREEZE);
|
||||
@ -82,7 +82,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(blissey!.getTag(BattlerTagType.FIRE_BOOST)).toBeDefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("not passing with baton pass", async () => {
|
||||
game.override.enemyMoveset([MoveId.EMBER]).moveset([MoveId.BATON_PASS]);
|
||||
@ -98,7 +98,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
const chansey = game.scene.getPlayerPokemon()!;
|
||||
expect(game.scene.getPlayerPokemon()!.species.speciesId).toBe(SpeciesId.CHANSEY);
|
||||
expect(chansey!.getTag(BattlerTagType.FIRE_BOOST)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("boosts Fire-type move when the ability is activated", async () => {
|
||||
game.override
|
||||
@ -126,7 +126,7 @@ describe("Abilities - Flash Fire", () => {
|
||||
const flashFireDmg = initialHP - blissey.hp;
|
||||
|
||||
expect(flashFireDmg).toBeGreaterThan(originalDmg);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("still activates regardless of accuracy check", async () => {
|
||||
game.override
|
||||
@ -158,5 +158,5 @@ describe("Abilities - Flash Fire", () => {
|
||||
const flashFireDmg = initialHP - blissey.hp;
|
||||
|
||||
expect(flashFireDmg).toBeGreaterThan(originalDmg);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -89,7 +89,6 @@ describe("Abilities - Flower Veil", () => {
|
||||
await game.move.selectEnemyMove(MoveId.THUNDER_WAVE);
|
||||
await game.toNextTurn();
|
||||
expect(game.scene.getPlayerPokemon()!.status).toBeUndefined();
|
||||
vi.spyOn(allMoves[MoveId.THUNDER_WAVE], "accuracy", "get").mockClear();
|
||||
});
|
||||
|
||||
it("should not prevent status conditions for a non-grass user and its non-grass allies", async () => {
|
||||
|
@ -4,17 +4,15 @@ import { SpeciesId } from "#enums/species-id";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi, type MockInstance } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { isNullOrUndefined } from "#app/utils/common";
|
||||
import { allAbilities } from "#app/data/data-lists";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { PostTurnResetStatusAbAttr } from "#app/@types/ability-types";
|
||||
import { PostTurnResetStatusAbAttr } from "#app/data/abilities/ability";
|
||||
|
||||
describe("Abilities - Healer", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
let healerAttrSpy: MockInstance;
|
||||
let healerAttr: PostTurnResetStatusAbAttr;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
@ -24,7 +22,6 @@ describe("Abilities - Healer", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
healerAttrSpy.mockRestore();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
@ -38,30 +35,28 @@ describe("Abilities - Healer", () => {
|
||||
.enemyAbility(AbilityId.BALL_FETCH)
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
|
||||
healerAttr = allAbilities[AbilityId.HEALER].getAttrs("PostTurnResetStatusAbAttr")[0];
|
||||
healerAttrSpy = vi
|
||||
.spyOn(healerAttr, "getCondition")
|
||||
.mockReturnValue((pokemon: Pokemon) => !isNullOrUndefined(pokemon.getAlly()));
|
||||
// Mock healer to have a 100% chance of healing its ally
|
||||
vi.spyOn(allAbilities[AbilityId.HEALER].getAttrs("PostTurnResetStatusAbAttr")[0], "getCondition").mockReturnValue(
|
||||
(pokemon: Pokemon) => !isNullOrUndefined(pokemon.getAlly()),
|
||||
);
|
||||
});
|
||||
|
||||
it("should not queue a message phase for healing if the ally has fainted", async () => {
|
||||
const abSpy = vi.spyOn(PostTurnResetStatusAbAttr.prototype, "canApplyPostTurn");
|
||||
game.override.moveset([MoveId.SPLASH, MoveId.LUNAR_DANCE]);
|
||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
||||
|
||||
const user = game.scene.getPlayerPokemon()!;
|
||||
// Only want one magikarp to have the ability.
|
||||
// Only want one magikarp to have the ability
|
||||
vi.spyOn(user, "getAbility").mockReturnValue(allAbilities[AbilityId.HEALER]);
|
||||
game.move.select(MoveId.SPLASH);
|
||||
// faint the ally
|
||||
game.move.select(MoveId.LUNAR_DANCE, 1);
|
||||
const abSpy = vi.spyOn(healerAttr, "canApplyPostTurn");
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
// It's not enough to just test that the ally still has its status.
|
||||
// We need to ensure that the ability failed to meet its condition
|
||||
expect(abSpy).toHaveReturnedWith(false);
|
||||
|
||||
// Explicitly restore the mock to ensure pollution doesn't happen
|
||||
abSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("should heal the status of an ally if the ally has a status", async () => {
|
||||
|
@ -62,7 +62,7 @@ describe("Abilities - Intimidate", () => {
|
||||
expect(playerPokemon.species.speciesId).toBe(SpeciesId.POOCHYENA);
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0);
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should lower ATK stat stage by 1 for every enemy Pokemon in a double battle on entry", async () => {
|
||||
game.override.battleStyle("double").startingWave(3);
|
||||
@ -85,7 +85,7 @@ describe("Abilities - Intimidate", () => {
|
||||
expect(enemyField[1].getStatStage(Stat.ATK)).toBe(-2);
|
||||
expect(playerField[0].getStatStage(Stat.ATK)).toBe(-2);
|
||||
expect(playerField[1].getStatStage(Stat.ATK)).toBe(-2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not activate again if there is no switch or new entry", async () => {
|
||||
game.override.startingWave(2).moveset([MoveId.SPLASH]);
|
||||
@ -102,7 +102,7 @@ describe("Abilities - Intimidate", () => {
|
||||
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-1);
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should lower ATK stat stage by 1 for every switch", async () => {
|
||||
game.override.moveset([MoveId.SPLASH]).enemyMoveset([MoveId.VOLT_SWITCH]).startingWave(5);
|
||||
@ -129,5 +129,5 @@ describe("Abilities - Intimidate", () => {
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-3);
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(0);
|
||||
}, 200000);
|
||||
});
|
||||
});
|
||||
|
@ -39,5 +39,5 @@ describe("Abilities - Intrepid Sword", () => {
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ describe("Abilities - Moxie", () => {
|
||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(VictoryPhase);
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
// TODO: Activate this test when MOXIE is corrected to work on faint and not on battle victory
|
||||
it.todo(
|
||||
|
@ -63,7 +63,7 @@ describe("Abilities - Mycelium Might", () => {
|
||||
|
||||
// Despite the opponent's ability (Clear Body), its ATK stat stage is still reduced.
|
||||
expect(enemyPokemon?.getStatStage(Stat.ATK)).toBe(-1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("will still go first if a status move that is in a higher priority bracket than the opponent's move is used", async () => {
|
||||
game.override.enemyMoveset(MoveId.TACKLE);
|
||||
@ -86,7 +86,7 @@ describe("Abilities - Mycelium Might", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
// Despite the opponent's ability (Clear Body), its ATK stat stage is still reduced.
|
||||
expect(enemyPokemon?.getStatStage(Stat.ATK)).toBe(-1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("will not affect non-status moves", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.REGIELEKI]);
|
||||
@ -105,5 +105,5 @@ describe("Abilities - Mycelium Might", () => {
|
||||
// This means that the commandOrder should be identical to the speedOrder
|
||||
expect(speedOrder).toEqual([playerIndex, enemyIndex]);
|
||||
expect(commandOrder).toEqual([playerIndex, enemyIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -54,8 +54,8 @@ describe("Abilities - Quick Draw", () => {
|
||||
|
||||
expect(pokemon.isFainted()).toBe(false);
|
||||
expect(enemy.isFainted()).toBe(true);
|
||||
expect(pokemon.waveData.abilitiesApplied).contain(AbilityId.QUICK_DRAW);
|
||||
}, 20000);
|
||||
expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.QUICK_DRAW);
|
||||
});
|
||||
|
||||
test(
|
||||
"does not triggered by non damage moves",
|
||||
@ -96,6 +96,6 @@ describe("Abilities - Quick Draw", () => {
|
||||
|
||||
expect(pokemon.isFainted()).toBe(true);
|
||||
expect(enemy.isFainted()).toBe(false);
|
||||
expect(pokemon.waveData.abilitiesApplied).contain(AbilityId.QUICK_DRAW);
|
||||
}, 20000);
|
||||
expect(pokemon.waveData.abilitiesApplied).toContain(AbilityId.QUICK_DRAW);
|
||||
});
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ describe("Abilities - Sand Spit", () => {
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SANDSTORM);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should trigger even when fainting", async () => {
|
||||
game.override.enemyMoveset([MoveId.TACKLE]).enemyLevel(100).startingLevel(1);
|
||||
@ -61,5 +61,5 @@ describe("Abilities - Sand Spit", () => {
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).not.toBe(WeatherType.SANDSTORM);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -69,7 +69,7 @@ describe("Abilities - Sheer Force", () => {
|
||||
await game.phaseInterceptor.to("BerryPhase", false);
|
||||
|
||||
expect(bindMove.calculateBattlePower).toHaveLastReturnedWith(bindMove.power);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Sheer Force does not boost the base damage of moves with no secondary effect", async () => {
|
||||
game.override.moveset([MoveId.TACKLE]);
|
||||
|
@ -36,5 +36,5 @@ describe("Abilities - Simple", () => {
|
||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(enemyPokemon.getStatStage(Stat.ATK)).toBe(-2);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ describe("Abilities - Stall", () => {
|
||||
// The opponent Pokemon (with Stall) goes last despite having higher speed than the player Pokemon.
|
||||
expect(speedOrder).toEqual([enemyIndex, playerIndex]);
|
||||
expect(commandOrder).toEqual([playerIndex, enemyIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.SHUCKLE]);
|
||||
@ -71,7 +71,7 @@ describe("Abilities - Stall", () => {
|
||||
// The player Pokemon goes second because its move is in a lower priority bracket.
|
||||
expect(speedOrder).toEqual([enemyIndex, playerIndex]);
|
||||
expect(commandOrder).toEqual([enemyIndex, playerIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("If both Pokemon have stall and use the same move, speed is used to determine who goes first.", async () => {
|
||||
game.override.ability(AbilityId.STALL);
|
||||
@ -91,5 +91,5 @@ describe("Abilities - Stall", () => {
|
||||
// The player Pokemon (with Stall) goes second because its speed is lower.
|
||||
expect(speedOrder).toEqual([enemyIndex, playerIndex]);
|
||||
expect(commandOrder).toEqual([enemyIndex, playerIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -30,13 +30,13 @@ describe("Abilities - Super Luck", () => {
|
||||
.enemyMoveset(MoveId.SPLASH);
|
||||
});
|
||||
|
||||
it("should increase the crit stage of a user by 1", async () => {
|
||||
it("should increase the user's crit stage by 1", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
|
||||
const enemy = game.scene.getEnemyPokemon()!;
|
||||
const fn = vi.spyOn(enemy, "getCritStage");
|
||||
const critSpy = vi.spyOn(enemy, "getCritStage"); // crit stage is called on enemy
|
||||
|
||||
game.move.select(MoveId.TACKLE);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
expect(fn).toHaveReturnedWith(1);
|
||||
fn.mockRestore();
|
||||
expect(critSpy).toHaveReturnedWith(1);
|
||||
});
|
||||
});
|
||||
|
@ -93,8 +93,6 @@ describe("Abilities - Tera Shell", () => {
|
||||
await game.phaseInterceptor.to("BerryPhase", false);
|
||||
expect(spy).toHaveLastReturnedWith(1);
|
||||
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp() - 40);
|
||||
|
||||
spy.mockRestore();
|
||||
});
|
||||
|
||||
it("should change the effectiveness of all strikes of a multi-strike move", async () => {
|
||||
@ -114,6 +112,5 @@ describe("Abilities - Tera Shell", () => {
|
||||
expect(spy).toHaveLastReturnedWith(0.5);
|
||||
}
|
||||
expect(spy).toHaveReturnedTimes(2);
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ describe("Battle order", () => {
|
||||
const order = phase.getCommandOrder();
|
||||
expect(order[0]).toBe(enemyPokemonIndex);
|
||||
expect(order[1]).toBe(playerPokemonIndex);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Player faster than opponent 150 vs 50", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.BULBASAUR]);
|
||||
@ -68,7 +68,7 @@ describe("Battle order", () => {
|
||||
const order = phase.getCommandOrder();
|
||||
expect(order[0]).toBe(playerPokemonIndex);
|
||||
expect(order[1]).toBe(enemyPokemonIndex);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("double - both opponents faster than player 50/50 vs 150/150", async () => {
|
||||
game.override.battleStyle("double");
|
||||
@ -92,7 +92,7 @@ describe("Battle order", () => {
|
||||
expect(order.slice(0, 2).includes(enemyIndices[1])).toBe(true);
|
||||
expect(order.slice(2, 4).includes(playerIndices[0])).toBe(true);
|
||||
expect(order.slice(2, 4).includes(playerIndices[1])).toBe(true);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("double - speed tie except 1 - 100/100 vs 100/150", async () => {
|
||||
game.override.battleStyle("double");
|
||||
@ -112,11 +112,10 @@ describe("Battle order", () => {
|
||||
|
||||
const phase = game.scene.phaseManager.getCurrentPhase() as TurnStartPhase;
|
||||
const order = phase.getCommandOrder();
|
||||
// enemy 2 should be first, followed by some other assortment of the other 3 pokemon
|
||||
expect(order[0]).toBe(enemyIndices[1]);
|
||||
expect(order.slice(1, 4).includes(enemyIndices[0])).toBe(true);
|
||||
expect(order.slice(1, 4).includes(playerIndices[0])).toBe(true);
|
||||
expect(order.slice(1, 4).includes(playerIndices[1])).toBe(true);
|
||||
}, 20000);
|
||||
expect(order.slice(1, 4)).toEqual(expect.arrayContaining([enemyIndices[0], ...playerIndices]));
|
||||
});
|
||||
|
||||
it("double - speed tie 100/150 vs 100/150", async () => {
|
||||
game.override.battleStyle("double");
|
||||
@ -137,9 +136,8 @@ describe("Battle order", () => {
|
||||
|
||||
const phase = game.scene.phaseManager.getCurrentPhase() as TurnStartPhase;
|
||||
const order = phase.getCommandOrder();
|
||||
expect(order.slice(0, 2).includes(playerIndices[1])).toBe(true);
|
||||
expect(order.slice(0, 2).includes(enemyIndices[1])).toBe(true);
|
||||
expect(order.slice(2, 4).includes(playerIndices[0])).toBe(true);
|
||||
expect(order.slice(2, 4).includes(enemyIndices[0])).toBe(true);
|
||||
}, 20000);
|
||||
// P2/E2 should be randomly first/second, then P1/E1 randomly 3rd/4th
|
||||
expect(order.slice(0, 2)).toStrictEqual(expect.arrayContaining([playerIndices[1], enemyIndices[1]]));
|
||||
expect(order.slice(2, 4)).toStrictEqual(expect.arrayContaining([playerIndices[0], enemyIndices[0]]));
|
||||
});
|
||||
});
|
||||
|
@ -60,7 +60,7 @@ describe("Test Battle Phase", () => {
|
||||
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.TITLE);
|
||||
expect(game.scene.gameData.gender).toBe(PlayerGender.MALE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("test phase interceptor with prompt with preparation for a future prompt", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
@ -81,20 +81,20 @@ describe("Test Battle Phase", () => {
|
||||
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.TITLE);
|
||||
expect(game.scene.gameData.gender).toBe(PlayerGender.MALE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("newGame one-liner", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("do attack wave 3 - single battle - regular - OHKO", async () => {
|
||||
game.override.enemySpecies(SpeciesId.RATTATA).startingLevel(2000).battleStyle("single");
|
||||
game.override.enemySpecies(SpeciesId.RATTATA).startingLevel(2000).battleStyle("single").startingWave(3);
|
||||
await game.classicMode.startBattle([SpeciesId.MEWTWO]);
|
||||
game.move.use(MoveId.TACKLE);
|
||||
await game.phaseInterceptor.to("SelectModifierPhase");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("do attack wave 3 - single battle - regular - NO OHKO with opponent using non damage attack", async () => {
|
||||
game.override
|
||||
@ -108,7 +108,7 @@ describe("Test Battle Phase", () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MEWTWO]);
|
||||
game.move.select(MoveId.TACKLE);
|
||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase, false);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("load 100% data file", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -117,14 +117,16 @@ describe("Test Battle Phase", () => {
|
||||
return species.caughtAttr !== 0n;
|
||||
}).length;
|
||||
expect(caughtCount).toBe(Object.keys(allSpecies).length);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("start battle with selected team", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.CHARIZARD, SpeciesId.CHANSEY, SpeciesId.MEW]);
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.CHARIZARD);
|
||||
expect(game.scene.getPlayerParty()[1].species.speciesId).toBe(SpeciesId.CHANSEY);
|
||||
expect(game.scene.getPlayerParty()[2].species.speciesId).toBe(SpeciesId.MEW);
|
||||
}, 20000);
|
||||
expect(game.scene.getPlayerParty().map(p => p.species.speciesId)).toEqual([
|
||||
SpeciesId.CHARIZARD,
|
||||
SpeciesId.CHANSEY,
|
||||
SpeciesId.MEW,
|
||||
]);
|
||||
});
|
||||
|
||||
it("test remove random battle seed int", async () => {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
@ -138,12 +140,12 @@ describe("Test Battle Phase", () => {
|
||||
await game.phaseInterceptor.run(LoginPhase).catch(e => {
|
||||
expect(e).toBe("Wrong phase: this is SelectGenderPhase and not LoginPhase");
|
||||
});
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("wrong phase but skip", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
await game.phaseInterceptor.run(LoginPhase, () => game.isCurrentPhase(SelectGenderPhase));
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("good run", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
@ -158,7 +160,7 @@ describe("Test Battle Phase", () => {
|
||||
);
|
||||
await game.phaseInterceptor.run(SelectGenderPhase, () => game.isCurrentPhase(TitlePhase));
|
||||
await game.phaseInterceptor.run(TitlePhase);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("good run from select gender to title", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
@ -172,7 +174,7 @@ describe("Test Battle Phase", () => {
|
||||
() => game.isCurrentPhase(TitlePhase),
|
||||
);
|
||||
await game.phaseInterceptor.runFrom(SelectGenderPhase).to(TitlePhase);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("good run to SummonPhase phase", async () => {
|
||||
await game.phaseInterceptor.run(LoginPhase);
|
||||
@ -193,7 +195,7 @@ describe("Test Battle Phase", () => {
|
||||
selectStarterPhase.initBattle(starters);
|
||||
});
|
||||
await game.phaseInterceptor.runFrom(SelectGenderPhase).to(SummonPhase);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("2vs1", async () => {
|
||||
game.override.battleStyle("single");
|
||||
@ -274,7 +276,7 @@ describe("Test Battle Phase", () => {
|
||||
game.move.select(moveToUse);
|
||||
await game.toNextTurn();
|
||||
expect(game.scene.currentBattle.turn).toBeGreaterThan(turn);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("does not set new weather if staying in same biome", async () => {
|
||||
const moveToUse = MoveId.SPLASH;
|
||||
@ -298,7 +300,7 @@ describe("Test Battle Phase", () => {
|
||||
await game.toNextWave();
|
||||
expect(game.scene.arena.trySetWeather).not.toHaveBeenCalled();
|
||||
expect(game.scene.currentBattle.waveIndex).toBeGreaterThan(waveIndex);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("does not force switch if active pokemon faints at same time as enemy mon and is revived in post-battle", async () => {
|
||||
const moveToUse = MoveId.TAKE_DOWN;
|
||||
@ -329,5 +331,5 @@ describe("Test Battle Phase", () => {
|
||||
() => game.isCurrentPhase(NextEncounterPhase),
|
||||
);
|
||||
await game.phaseInterceptor.to(SwitchPhase);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -56,7 +56,7 @@ describe("Double Battles", () => {
|
||||
|
||||
await game.phaseInterceptor.to(TurnInitPhase);
|
||||
expect(game.scene.getPlayerField().filter(p => !p.isFainted())).toHaveLength(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("randomly chooses between single and double battles if there is no battle type override", async () => {
|
||||
let rngSweepProgress = 0; // Will simulate RNG rolls by slowly increasing from 0 to 1
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { AbilityId } from "#enums/ability-id";
|
||||
import { MoveId } from "#enums/move-id";
|
||||
@ -32,66 +31,67 @@ describe("Test Battle Phase", () => {
|
||||
.enemyMoveset(MoveId.TACKLE);
|
||||
});
|
||||
|
||||
// TODO: Make these into `it.each`es
|
||||
it("startBattle 2vs1 boss", async () => {
|
||||
game.override.battleStyle("single").startingWave(10);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs2 boss", async () => {
|
||||
game.override.battleStyle("double").startingWave(10);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs2 trainer", async () => {
|
||||
game.override.battleStyle("double").startingWave(5);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs1 trainer", async () => {
|
||||
game.override.battleStyle("single").startingWave(5);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs1 rival", async () => {
|
||||
game.override.battleStyle("single").startingWave(8);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs2 rival", async () => {
|
||||
game.override.battleStyle("double").startingWave(8);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 1vs1 trainer", async () => {
|
||||
game.override.battleStyle("single").startingWave(5);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 2vs2 trainer", async () => {
|
||||
game.override.battleStyle("double").startingWave(5);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
|
||||
it("startBattle 4vs2 trainer", async () => {
|
||||
game.override.battleStyle("double").startingWave(5);
|
||||
await game.classicMode.startBattle([SpeciesId.BLASTOISE, SpeciesId.CHARIZARD, SpeciesId.DARKRAI, SpeciesId.GABITE]);
|
||||
expect(game.scene.ui?.getMode()).toBe(UiMode.COMMAND);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(CommandPhase.name);
|
||||
}, 20000);
|
||||
expect(game.scene.phaseManager.getCurrentPhase()?.phaseName).toBe("CommandPhase");
|
||||
});
|
||||
});
|
||||
|
@ -13,7 +13,7 @@ import { SpeciesId } from "#enums/species-id";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import { mockI18next } from "#test/testUtils/testUtils";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
const pokemonName = "PKM";
|
||||
const sourceText = "SOURCE";
|
||||
@ -294,10 +294,6 @@ describe("Status Effect Messages", () => {
|
||||
expect(text).toBe("statusEffect:burn.overlap");
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Status Effects", () => {
|
||||
|
@ -25,7 +25,6 @@ describe("Egg Generation Tests", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -21,7 +21,6 @@ describe("Manaphy Eggs", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
@ -94,7 +94,7 @@ describe("Escape chance calculations", () => {
|
||||
phase.attemptRunAway(playerPokemon, enemyField, escapePercentage);
|
||||
expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance);
|
||||
}
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("double non-boss opponent", async () => {
|
||||
game.override.battleStyle("double");
|
||||
@ -180,7 +180,7 @@ describe("Escape chance calculations", () => {
|
||||
escapeChances[i].pokemonSpeedRatio * totalEnemySpeed,
|
||||
);
|
||||
}
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("single boss opponent", async () => {
|
||||
game.override.startingWave(10);
|
||||
@ -259,7 +259,7 @@ describe("Escape chance calculations", () => {
|
||||
phase.attemptRunAway(playerPokemon, enemyField, escapePercentage);
|
||||
expect(escapePercentage.value).toBe(escapeChances[i].expectedEscapeChance);
|
||||
}
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("double boss opponent", async () => {
|
||||
game.override.battleStyle("double").startingWave(10);
|
||||
@ -357,5 +357,5 @@ describe("Escape chance calculations", () => {
|
||||
escapeChances[i].pokemonSpeedRatio * totalEnemySpeed,
|
||||
);
|
||||
}
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -15,8 +15,6 @@ describe("game-mode", () => {
|
||||
});
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
|
@ -37,7 +37,7 @@ describe("Items - Dire Hit", () => {
|
||||
.moveset([MoveId.POUND])
|
||||
.startingHeldItems([{ name: "DIRE_HIT" }])
|
||||
.battleStyle("single");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 1", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.GASTLY]);
|
||||
@ -51,7 +51,7 @@ describe("Items - Dire Hit", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyPokemon.getCritStage).toHaveReturnedWith(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should renew how many battles are left of existing DIRE_HIT when picking up new DIRE_HIT", async () => {
|
||||
game.override.itemRewards([{ name: "DIRE_HIT" }]);
|
||||
@ -93,5 +93,5 @@ describe("Items - Dire Hit", () => {
|
||||
}
|
||||
}
|
||||
expect(count).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -34,5 +34,5 @@ describe("EXP Modifier Items", () => {
|
||||
const expHolder = new NumberHolder(partyMember.exp);
|
||||
game.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, expHolder);
|
||||
expect(expHolder.value).toBe(440);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -43,7 +43,7 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 2 when held by GALAR_FARFETCHD", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.GALAR_FARFETCHD]);
|
||||
@ -57,7 +57,7 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 2 when held by SIRFETCHD", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.SIRFETCHD]);
|
||||
@ -71,7 +71,7 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 2 when held by FARFETCHD line fused with Pokemon", async () => {
|
||||
// Randomly choose from the Farfetch'd line
|
||||
@ -99,7 +99,7 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 2 when held by Pokemon fused with FARFETCHD line", async () => {
|
||||
// Randomly choose from the Farfetch'd line
|
||||
@ -127,7 +127,7 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not raise CRIT stage when held by a Pokemon outside of FARFETCHD line", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||
@ -141,5 +141,5 @@ describe("Items - Leek", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyMember.getCritStage).toHaveReturnedWith(0);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -56,5 +56,5 @@ describe("Items - Leftovers", () => {
|
||||
// Check if leftovers heal us
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
expect(leadPokemon.hp).toBeGreaterThan(leadHpAfterDamage);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ describe("Items - Light Ball", () => {
|
||||
|
||||
expect(atkValue.value / atkStat).toBe(2);
|
||||
expect(spAtkValue.value / spAtkStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("LIGHT_BALL held by fused PIKACHU (base)", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.PIKACHU, SpeciesId.MAROWAK]);
|
||||
@ -147,7 +147,7 @@ describe("Items - Light Ball", () => {
|
||||
|
||||
expect(atkValue.value / atkStat).toBe(2);
|
||||
expect(spAtkValue.value / spAtkStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("LIGHT_BALL held by fused PIKACHU (part)", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAROWAK, SpeciesId.PIKACHU]);
|
||||
@ -186,7 +186,7 @@ describe("Items - Light Ball", () => {
|
||||
|
||||
expect(atkValue.value / atkStat).toBe(2);
|
||||
expect(spAtkValue.value / spAtkStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("LIGHT_BALL not held by PIKACHU", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAROWAK]);
|
||||
@ -215,5 +215,5 @@ describe("Items - Light Ball", () => {
|
||||
|
||||
expect(atkValue.value / atkStat).toBe(1);
|
||||
expect(spAtkValue.value / spAtkStat).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -49,5 +49,5 @@ describe("Items - Lock Capsule", () => {
|
||||
|
||||
game.doSelectModifier();
|
||||
await game.phaseInterceptor.to("SelectModifierPhase");
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -102,7 +102,7 @@ describe("Items - Metal Powder", () => {
|
||||
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.DEF, defValue);
|
||||
|
||||
expect(defValue.value / defStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("METAL_POWDER held by fused DITTO (base)", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.DITTO, SpeciesId.MAROWAK]);
|
||||
@ -135,7 +135,7 @@ describe("Items - Metal Powder", () => {
|
||||
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.DEF, defValue);
|
||||
|
||||
expect(defValue.value / defStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("METAL_POWDER held by fused DITTO (part)", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAROWAK, SpeciesId.DITTO]);
|
||||
@ -168,7 +168,7 @@ describe("Items - Metal Powder", () => {
|
||||
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.DEF, defValue);
|
||||
|
||||
expect(defValue.value / defStat).toBe(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("METAL_POWDER not held by DITTO", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.MAROWAK]);
|
||||
@ -191,5 +191,5 @@ describe("Items - Metal Powder", () => {
|
||||
game.scene.applyModifiers(SpeciesStatBoosterModifier, true, partyMember, Stat.DEF, defValue);
|
||||
|
||||
expect(defValue.value / defStat).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -28,7 +28,7 @@ describe("Items - Scope Lens", () => {
|
||||
.moveset([MoveId.POUND])
|
||||
.startingHeldItems([{ name: "SCOPE_LENS" }])
|
||||
.battleStyle("single");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should raise CRIT stage by 1", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.GASTLY]);
|
||||
@ -42,5 +42,5 @@ describe("Items - Scope Lens", () => {
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
|
||||
expect(enemyPokemon.getCritStage).toHaveReturnedWith(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
await game.phaseInterceptor.runFrom("EnemyCommandPhase").to(TurnEndPhase);
|
||||
|
||||
expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(1.3);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should increase existing ACC stat stage by 1 for X_ACCURACY only", async () => {
|
||||
game.override.startingModifier([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ACC }]).ability(AbilityId.SIMPLE);
|
||||
@ -72,7 +72,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
|
||||
// ACC at +3 stat stages yields a x2 multiplier
|
||||
expect(partyMember.getAccuracyMultiplier).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should increase existing stat stage multiplier by 3/10 for the rest of the boosters", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||
@ -92,7 +92,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
|
||||
// ATK at +1 stat stage yields a x1.5 multiplier, add 0.3 from X_ATTACK
|
||||
expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(1.8);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not increase past maximum stat stage multiplier", async () => {
|
||||
game.override.startingModifier([
|
||||
@ -116,7 +116,7 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
|
||||
expect(partyMember.getAccuracyMultiplier).toHaveReturnedWith(3);
|
||||
expect(partyMember.getStatStageMultiplier).toHaveReturnedWith(4);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should renew how many battles are left of existing booster when picking up new booster of same type", async () => {
|
||||
game.override.startingLevel(200).itemRewards([{ name: "TEMP_STAT_STAGE_BOOSTER", type: Stat.ATK }]);
|
||||
@ -161,5 +161,5 @@ describe("Items - Temporary Stat Stage Boosters", () => {
|
||||
}
|
||||
}
|
||||
expect(count).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ describe("Moves - Baton Pass", () => {
|
||||
playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
expect(playerPokemon.species.speciesId).toEqual(SpeciesId.SHUCKLE);
|
||||
expect(playerPokemon.getStatStage(Stat.SPATK)).toEqual(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("passes stat stage buffs when AI uses it", async () => {
|
||||
// arrange
|
||||
@ -82,7 +82,7 @@ describe("Moves - Baton Pass", () => {
|
||||
"SummonPhase",
|
||||
"PostSummonPhase",
|
||||
]);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("doesn't transfer effects that aren't transferrable", async () => {
|
||||
game.override.enemyMoveset([MoveId.SALT_CURE]);
|
||||
@ -98,7 +98,7 @@ describe("Moves - Baton Pass", () => {
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(player2.findTag(t => t.tagType === BattlerTagType.SALT_CURED)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("doesn't allow binding effects from the user to persist", async () => {
|
||||
game.override.moveset([MoveId.FIRE_SPIN, MoveId.BATON_PASS]);
|
||||
|
@ -60,7 +60,7 @@ describe("Moves - Disable", () => {
|
||||
result: MoveResult.FAIL,
|
||||
});
|
||||
expect(enemyMon.isMoveRestricted(MoveId.SPLASH)).toBe(false);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("causes STRUGGLE if all usable moves are disabled", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
@ -78,7 +78,7 @@ describe("Moves - Disable", () => {
|
||||
expect(enemyHistory).toHaveLength(2);
|
||||
expect(enemyHistory[0].move).toBe(MoveId.SPLASH);
|
||||
expect(enemyHistory[1].move).toBe(MoveId.STRUGGLE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("cannot disable STRUGGLE", async () => {
|
||||
game.override.enemyMoveset([MoveId.STRUGGLE]);
|
||||
@ -94,7 +94,7 @@ describe("Moves - Disable", () => {
|
||||
expect(playerMon.getLastXMoves()[0].result).toBe(MoveResult.FAIL);
|
||||
expect(enemyMon.getLastXMoves()[0].move).toBe(MoveId.STRUGGLE);
|
||||
expect(enemyMon.isMoveRestricted(MoveId.STRUGGLE)).toBe(false);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("interrupts target's move when target moves after", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
@ -116,7 +116,7 @@ describe("Moves - Disable", () => {
|
||||
result: MoveResult.SUCCESS,
|
||||
});
|
||||
expect(enemyHistory[1].result).toBe(MoveResult.FAIL);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("disables NATURE POWER, not the move invoked by it", async () => {
|
||||
game.override.enemyMoveset([MoveId.NATURE_POWER]);
|
||||
@ -130,7 +130,7 @@ describe("Moves - Disable", () => {
|
||||
|
||||
expect(enemyMon.isMoveRestricted(MoveId.NATURE_POWER)).toBe(true);
|
||||
expect(enemyMon.isMoveRestricted(enemyMon.getLastXMoves(2)[0].move)).toBe(false);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("disables most recent move", async () => {
|
||||
game.override.enemyMoveset([MoveId.SPLASH, MoveId.TACKLE]);
|
||||
@ -150,5 +150,5 @@ describe("Moves - Disable", () => {
|
||||
|
||||
expect(enemyMon.isMoveRestricted(MoveId.TACKLE)).toBe(true);
|
||||
expect(enemyMon.isMoveRestricted(MoveId.SPLASH)).toBe(false);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -51,7 +51,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(dynamaxCannon.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(100);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 100 power against an enemy at level cap", async () => {
|
||||
game.override.enemyLevel(10);
|
||||
@ -63,7 +63,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(dynamaxCannon.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(100);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 120 power against an enemy 1% above level cap", async () => {
|
||||
game.override.enemyLevel(101);
|
||||
@ -78,7 +78,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
vi.spyOn(game.scene, "getMaxExpLevel").mockReturnValue(100);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(120);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 140 power against an enemy 2% above level capp", async () => {
|
||||
game.override.enemyLevel(102);
|
||||
@ -93,7 +93,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
vi.spyOn(game.scene, "getMaxExpLevel").mockReturnValue(100);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(140);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 160 power against an enemy 3% above level cap", async () => {
|
||||
game.override.enemyLevel(103);
|
||||
@ -108,7 +108,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
vi.spyOn(game.scene, "getMaxExpLevel").mockReturnValue(100);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(160);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 180 power against an enemy 4% above level cap", async () => {
|
||||
game.override.enemyLevel(104);
|
||||
@ -123,7 +123,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
vi.spyOn(game.scene, "getMaxExpLevel").mockReturnValue(100);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(180);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 200 power against an enemy 5% above level cap", async () => {
|
||||
game.override.enemyLevel(105);
|
||||
@ -138,7 +138,7 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
vi.spyOn(game.scene, "getMaxExpLevel").mockReturnValue(100);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should return 200 power against an enemy way above level cap", async () => {
|
||||
game.override.enemyLevel(999);
|
||||
@ -151,5 +151,5 @@ describe("Moves - Dynamax Cannon", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(dynamaxCannon.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(dynamaxCannon.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -45,5 +45,5 @@ describe("Moves - Fusion Bolt", () => {
|
||||
await game.toNextTurn();
|
||||
|
||||
expect(initialHp - partyMember.hp).toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -64,7 +64,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionBolt.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionBolt.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_BOLT should double power of subsequent FUSION_FLARE", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.ZEKROM, SpeciesId.ZEKROM]);
|
||||
@ -84,7 +84,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionFlare.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionFlare.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_FLARE should double power of subsequent FUSION_BOLT if a move failed in between", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.ZEKROM, SpeciesId.ZEKROM]);
|
||||
@ -109,7 +109,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionBolt.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionBolt.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_FLARE should not double power of subsequent FUSION_BOLT if a move succeeded in between", async () => {
|
||||
game.override.enemyMoveset(MoveId.SPLASH);
|
||||
@ -134,7 +134,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionBolt.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionBolt.calculateBattlePower).toHaveLastReturnedWith(100);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_FLARE should double power of subsequent FUSION_BOLT if moves are aimed at allies", async () => {
|
||||
await game.classicMode.startBattle([SpeciesId.ZEKROM, SpeciesId.RESHIRAM]);
|
||||
@ -154,7 +154,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionFlare.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionFlare.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves", async () => {
|
||||
game.override.enemyMoveset(fusionFlare.id);
|
||||
@ -208,7 +208,7 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionFlare.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionFlare.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("FUSION_FLARE and FUSION_BOLT alternating throughout turn should double power of subsequent moves if moves are aimed at allies", async () => {
|
||||
game.override.enemyMoveset(fusionFlare.id);
|
||||
@ -262,5 +262,5 @@ describe("Moves - Fusion Flare and Fusion Bolt", () => {
|
||||
expect((game.scene.phaseManager.getCurrentPhase() as MoveEffectPhase).move.id).toBe(fusionFlare.id);
|
||||
await game.phaseInterceptor.to(DamageAnimPhase, false);
|
||||
expect(fusionFlare.calculateBattlePower).toHaveLastReturnedWith(200);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -52,7 +52,7 @@ describe("Moves - Gigaton Hammer", () => {
|
||||
const enemy2 = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(enemy2.hp).toBe(enemy2.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("can be used again if recalled and sent back out", async () => {
|
||||
game.override.startingWave(4);
|
||||
@ -75,5 +75,5 @@ describe("Moves - Gigaton Hammer", () => {
|
||||
const enemy2 = game.scene.getEnemyPokemon()!;
|
||||
|
||||
expect(enemy2.hp).toBeLessThan(enemy2.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -43,5 +43,5 @@ describe("Moves - Growth", () => {
|
||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase);
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.SPATK)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ describe("Moves - Guard Split", () => {
|
||||
|
||||
expect(player.getStat(Stat.SPDEF, false)).toBe(avgSpDef);
|
||||
expect(enemy.getStat(Stat.SPDEF, false)).toBe(avgSpDef);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should be idempotent", async () => {
|
||||
game.override.enemyMoveset([MoveId.GUARD_SPLIT]);
|
||||
@ -73,5 +73,5 @@ describe("Moves - Guard Split", () => {
|
||||
|
||||
expect(player.getStat(Stat.SPDEF, false)).toBe(avgSpDef);
|
||||
expect(enemy.getStat(Stat.SPDEF, false)).toBe(avgSpDef);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -42,7 +42,7 @@ describe("Moves - Magnet Rise", () => {
|
||||
const finalHp = game.scene.getPlayerParty()[0].hp;
|
||||
const hpLost = finalHp - startingHp;
|
||||
expect(hpLost).toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("MAGNET RISE - Gravity", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
@ -58,5 +58,5 @@ describe("Moves - Magnet Rise", () => {
|
||||
finalHp = game.scene.getPlayerParty()[0].hp;
|
||||
hpLost = finalHp - startingHp;
|
||||
expect(hpLost).not.toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ describe("Moves - Power Split", () => {
|
||||
|
||||
expect(player.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
|
||||
expect(enemy.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should be idempotent", async () => {
|
||||
game.override.enemyMoveset([MoveId.POWER_SPLIT]);
|
||||
@ -73,5 +73,5 @@ describe("Moves - Power Split", () => {
|
||||
|
||||
expect(player.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
|
||||
expect(enemy.getStat(Stat.SPATK, false)).toBe(avgSpAtk);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -47,5 +47,5 @@ describe("Moves - Speed Swap", () => {
|
||||
|
||||
expect(player.getStat(Stat.SPD, false)).toBe(enemySpd);
|
||||
expect(enemy.getStat(Stat.SPD, false)).toBe(playerSpd);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ describe("Moves - Spikes", () => {
|
||||
|
||||
const player = game.scene.getPlayerParty()[0];
|
||||
expect(player.hp).toBe(player.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should damage opposing pokemon that are forced to switch in", async () => {
|
||||
game.override.startingWave(5);
|
||||
@ -63,7 +63,7 @@ describe("Moves - Spikes", () => {
|
||||
|
||||
const enemy = game.scene.getEnemyParty()[0];
|
||||
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should damage opposing pokemon that choose to switch in", async () => {
|
||||
game.override.startingWave(5);
|
||||
@ -78,7 +78,7 @@ describe("Moves - Spikes", () => {
|
||||
|
||||
const enemy = game.scene.getEnemyParty()[0];
|
||||
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should work when all targets fainted", async () => {
|
||||
game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(50);
|
||||
@ -89,5 +89,5 @@ describe("Moves - Spikes", () => {
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(game.scene.arena.getTagOnSide(ArenaTrapTag, ArenaTagSide.ENEMY)).toBeDefined();
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -43,8 +43,6 @@ describe("Moves - Struggle", () => {
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(stabSpy).toHaveReturnedWith(1);
|
||||
|
||||
stabSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("should ignore type effectiveness", async () => {
|
||||
@ -55,11 +53,8 @@ describe("Moves - Struggle", () => {
|
||||
game.move.select(MoveId.STRUGGLE);
|
||||
|
||||
const moveEffectivenessSpy = vi.spyOn(enemy, "getMoveEffectiveness");
|
||||
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(moveEffectivenessSpy).toHaveReturnedWith(1);
|
||||
|
||||
moveEffectivenessSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
@ -44,7 +44,7 @@ describe("Moves - Tackle", () => {
|
||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase);
|
||||
const hpLost = hpOpponent - game.scene.currentBattle.enemyParty[0].hp;
|
||||
expect(hpLost).toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("TACKLE against not resistant", async () => {
|
||||
const moveToUse = MoveId.TACKLE;
|
||||
@ -59,5 +59,5 @@ describe("Moves - Tackle", () => {
|
||||
const hpLost = hpOpponent - game.scene.currentBattle.enemyParty[0].hp;
|
||||
expect(hpLost).toBeGreaterThan(0);
|
||||
expect(hpLost).toBeLessThan(4);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -46,5 +46,5 @@ describe("Moves - Tail whip", () => {
|
||||
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase);
|
||||
|
||||
expect(enemyPokemon.getStatStage(Stat.DEF)).toBe(-1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -62,7 +62,7 @@ describe("Moves - Tera Blast", () => {
|
||||
await game.phaseInterceptor.to("MoveEffectPhase");
|
||||
|
||||
expect(spy).toHaveReturnedWith(2);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("increases power if user is Stellar tera type", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
|
@ -46,7 +46,7 @@ describe("Moves - Tidy Up", () => {
|
||||
game.move.select(MoveId.TIDY_UP);
|
||||
await game.phaseInterceptor.to(MoveEndPhase);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.SPIKES)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("stealth rocks are cleared", async () => {
|
||||
game.override.moveset([MoveId.STEALTH_ROCK, MoveId.TIDY_UP]).enemyMoveset(MoveId.STEALTH_ROCK);
|
||||
@ -57,7 +57,7 @@ describe("Moves - Tidy Up", () => {
|
||||
game.move.select(MoveId.TIDY_UP);
|
||||
await game.phaseInterceptor.to(MoveEndPhase);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.STEALTH_ROCK)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("toxic spikes are cleared", async () => {
|
||||
game.override.moveset([MoveId.TOXIC_SPIKES, MoveId.TIDY_UP]).enemyMoveset(MoveId.TOXIC_SPIKES);
|
||||
@ -68,7 +68,7 @@ describe("Moves - Tidy Up", () => {
|
||||
game.move.select(MoveId.TIDY_UP);
|
||||
await game.phaseInterceptor.to(MoveEndPhase);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.TOXIC_SPIKES)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("sticky webs are cleared", async () => {
|
||||
game.override.moveset([MoveId.STICKY_WEB, MoveId.TIDY_UP]).enemyMoveset(MoveId.STICKY_WEB);
|
||||
@ -80,7 +80,7 @@ describe("Moves - Tidy Up", () => {
|
||||
game.move.select(MoveId.TIDY_UP);
|
||||
await game.phaseInterceptor.to(MoveEndPhase);
|
||||
expect(game.scene.arena.getTag(ArenaTagType.STICKY_WEB)).toBeUndefined();
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("substitutes are cleared", async () => {
|
||||
game.override.moveset([MoveId.SUBSTITUTE, MoveId.TIDY_UP]).enemyMoveset(MoveId.SUBSTITUTE);
|
||||
@ -97,7 +97,7 @@ describe("Moves - Tidy Up", () => {
|
||||
expect(p).toBeDefined();
|
||||
expect(p!.getTag(SubstituteTag)).toBeUndefined();
|
||||
});
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("user's stats are raised with no traps set", async () => {
|
||||
await game.classicMode.startBattle();
|
||||
@ -112,5 +112,5 @@ describe("Moves - Tidy Up", () => {
|
||||
|
||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1);
|
||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -50,7 +50,7 @@ describe("Moves - U-turn", () => {
|
||||
);
|
||||
expect(game.phaseInterceptor.log).toContain("SwitchSummonPhase");
|
||||
expect(game.scene.getPlayerPokemon()!.species.speciesId).toBe(SpeciesId.SHUCKLE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("triggers rough skin on the u-turn user before a new pokemon is switched in", async () => {
|
||||
// arrange
|
||||
@ -68,7 +68,7 @@ describe("Moves - U-turn", () => {
|
||||
expect(game.scene.getEnemyPokemon()!.waveData.abilityRevealed).toBe(true); // proxy for asserting ability activated
|
||||
expect(playerPkm.species.speciesId).toEqual(SpeciesId.RAICHU);
|
||||
expect(game.phaseInterceptor.log).not.toContain("SwitchSummonPhase");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("triggers contact abilities on the u-turn user (eg poison point) before a new pokemon is switched in", async () => {
|
||||
// arrange
|
||||
@ -86,7 +86,7 @@ describe("Moves - U-turn", () => {
|
||||
expect(playerPkm.species.speciesId).toEqual(SpeciesId.RAICHU);
|
||||
expect(game.scene.getEnemyPokemon()!.waveData.abilityRevealed).toBe(true); // proxy for asserting ability activated
|
||||
expect(game.phaseInterceptor.log).not.toContain("SwitchSummonPhase");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("still forces a switch if u-turn KO's the opponent", async () => {
|
||||
game.override.startingLevel(1000); // Ensure that U-Turn KO's the opponent
|
||||
|
@ -55,8 +55,6 @@ describe("A Trainer's Test - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -54,8 +54,6 @@ describe("Absolute Avarice - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -56,8 +56,6 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -57,8 +57,6 @@ describe("Berries Abound - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -167,8 +167,6 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -68,8 +68,6 @@ describe("Clowning Around - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -57,8 +57,6 @@ describe("Dancing Lessons - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -59,8 +59,6 @@ describe("Delibird-y - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -49,8 +49,6 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -47,8 +47,6 @@ describe("Field Trip - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -66,8 +66,6 @@ describe("Fiery Fallout - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -53,8 +53,6 @@ describe("Fight or Flight - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -59,8 +59,6 @@ describe("Fun And Games! - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -54,8 +54,6 @@ describe("Global Trade System - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -50,8 +50,6 @@ describe("Lost at Sea - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -60,8 +60,6 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -53,8 +53,6 @@ describe("Part-Timer - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -55,8 +55,6 @@ describe("Safari Zone - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -64,8 +64,6 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -57,8 +57,6 @@ describe("The Expert Pokémon Breeder - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -55,8 +55,6 @@ describe("The Pokemon Salesman - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -65,8 +65,6 @@ describe("The Strong Stuff - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -61,8 +61,6 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
@ -307,7 +305,7 @@ describe("The Winstrate Challenge - Mystery Encounter", () => {
|
||||
) as ModifierSelectUiHandler;
|
||||
expect(modifierSelectHandler.options.length).toEqual(1);
|
||||
expect(modifierSelectHandler.options[0].modifierTypeOption.type.id).toBe("MYSTERY_ENCOUNTER_MACHO_BRACE");
|
||||
}, 15000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Option 2 - Refuse the Challenge", () => {
|
||||
|
@ -64,8 +64,6 @@ describe("Trash to Treasure - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -62,8 +62,6 @@ describe("Uncommon Breed - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -54,8 +54,6 @@ describe("Weird Dream - Mystery Encounter", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
vi.clearAllMocks();
|
||||
vi.resetAllMocks();
|
||||
});
|
||||
|
||||
it("should have the correct properties", async () => {
|
||||
|
@ -51,6 +51,6 @@ describe("Phases", () => {
|
||||
scene.phaseManager.unshiftPhase(unavailablePhase);
|
||||
await game.phaseInterceptor.to(UnavailablePhase);
|
||||
expect(scene.ui.getMode()).to.equal(UiMode.UNAVAILABLE);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -42,8 +42,6 @@ describe("SelectModifierPhase", () => {
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("should start a select modifier phase", async () => {
|
||||
|
@ -43,7 +43,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies after a biome switch", async () => {
|
||||
game.override
|
||||
@ -75,7 +75,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have weather inconsistencies after a biome switch", async () => {
|
||||
game.override
|
||||
@ -101,7 +101,7 @@ describe("Reload", () => {
|
||||
const postReloadWeather = game.scene.arena.weather;
|
||||
|
||||
expect(postReloadWeather).toStrictEqual(preReloadWeather);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run wild Pokemon fight", async () => {
|
||||
await game.dailyMode.startBattle();
|
||||
@ -113,7 +113,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run double battle", async () => {
|
||||
game.override.battleStyle("double");
|
||||
@ -126,7 +126,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run Gym Leader fight", async () => {
|
||||
game.override.battleStyle("single").startingWave(40);
|
||||
@ -139,7 +139,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run regular trainer fight", async () => {
|
||||
game.override.battleStyle("single").startingWave(45);
|
||||
@ -152,7 +152,7 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("should not have RNG inconsistencies at a Daily run wave 50 Boss fight", async () => {
|
||||
game.override.battleStyle("single").startingWave(50);
|
||||
@ -165,5 +165,5 @@ describe("Reload", () => {
|
||||
const postReloadRngState = Phaser.Math.RND.state();
|
||||
|
||||
expect(preReloadRngState).toBe(postReloadRngState);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import PokedexUiHandler from "#app/ui/pokedex-ui-handler";
|
||||
import { FilterTextRow } from "#app/ui/filter-text";
|
||||
import { allAbilities } from "#app/data/data-lists";
|
||||
@ -46,7 +46,6 @@ function permutations<T>(array: T[], length: number): T[][] {
|
||||
describe("UI - Pokedex", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
const mocks: MockInstance[] = [];
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
@ -55,9 +54,6 @@ describe("UI - Pokedex", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
while (mocks.length > 0) {
|
||||
mocks.pop()?.mockRestore();
|
||||
}
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
@ -185,10 +181,10 @@ describe("UI - Pokedex", () => {
|
||||
checks.push(...pokemon.forms);
|
||||
}
|
||||
for (const p of checks) {
|
||||
mocks.push(vi.spyOn(p, "ability1", "get").mockReturnValue(ability));
|
||||
mocks.push(vi.spyOn(p, "ability2", "get").mockReturnValue(ability2));
|
||||
mocks.push(vi.spyOn(p, "abilityHidden", "get").mockReturnValue(hidden));
|
||||
mocks.push(vi.spyOn(p, "getPassiveAbility").mockReturnValue(passive));
|
||||
vi.spyOn(p, "ability1", "get").mockReturnValue(ability);
|
||||
vi.spyOn(p, "ability2", "get").mockReturnValue(ability2);
|
||||
vi.spyOn(p, "abilityHidden", "get").mockReturnValue(hidden);
|
||||
vi.spyOn(p, "getPassiveAbility").mockReturnValue(passive);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].shiny).toBe(true);
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(2);
|
||||
expect(game.scene.getPlayerParty()[0].gender).toBe(Gender.MALE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - shiny - variant 2 female hardy overgrow", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -156,7 +156,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(2);
|
||||
expect(game.scene.getPlayerParty()[0].nature).toBe(Nature.HARDY);
|
||||
expect(game.scene.getPlayerParty()[0].getAbility().id).toBe(AbilityId.OVERGROW);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - shiny - variant 2 female lonely chlorophyl", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -221,7 +221,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].gender).toBe(Gender.FEMALE);
|
||||
expect(game.scene.getPlayerParty()[0].nature).toBe(Nature.LONELY);
|
||||
expect(game.scene.getPlayerParty()[0].getAbility().id).toBe(AbilityId.CHLOROPHYLL);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - shiny - variant 2 female", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -282,7 +282,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].shiny).toBe(true);
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(2);
|
||||
expect(game.scene.getPlayerParty()[0].gender).toBe(Gender.FEMALE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - not shiny", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -342,7 +342,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.BULBASAUR);
|
||||
expect(game.scene.getPlayerParty()[0].shiny).toBe(false);
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - shiny - variant 1", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -404,7 +404,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.BULBASAUR);
|
||||
expect(game.scene.getPlayerParty()[0].shiny).toBe(true);
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(1);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Bulbasaur - shiny - variant 0", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -465,7 +465,7 @@ describe("UI - Starter select", () => {
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.BULBASAUR);
|
||||
expect(game.scene.getPlayerParty()[0].shiny).toBe(true);
|
||||
expect(game.scene.getPlayerParty()[0].variant).toBe(0);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Check if first pokemon in party is caterpie from gen 1 and 1rd row, 3rd column", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -529,7 +529,7 @@ describe("UI - Starter select", () => {
|
||||
});
|
||||
await game.phaseInterceptor.whenAboutToRun(EncounterPhase);
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.CATERPIE);
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("Check if first pokemon in party is nidoran_m from gen 1 and 2nd row, 4th column (cursor (9+4)-1)", async () => {
|
||||
await game.importData("./test/testUtils/saves/everything.prsv");
|
||||
@ -595,5 +595,5 @@ describe("UI - Starter select", () => {
|
||||
});
|
||||
await game.phaseInterceptor.whenAboutToRun(EncounterPhase);
|
||||
expect(game.scene.getPlayerParty()[0].species.speciesId).toBe(SpeciesId.NIDORAN_M);
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
@ -77,7 +77,7 @@ describe("UI - Transfer Items", () => {
|
||||
});
|
||||
|
||||
await game.phaseInterceptor.to("SelectModifierPhase");
|
||||
}, 20000);
|
||||
});
|
||||
|
||||
it("check transfer option for pokemon to transfer to", async () => {
|
||||
game.onNextPrompt("SelectModifierPhase", UiMode.PARTY, () => {
|
||||
@ -98,5 +98,5 @@ describe("UI - Transfer Items", () => {
|
||||
});
|
||||
|
||||
await game.phaseInterceptor.to("SelectModifierPhase");
|
||||
}, 20000);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user