mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-04 13:49:32 +02:00
fix: berries abound tests
the "Should skip battle when fastest pokemon is faster than boss" test was failing due to the party being more than 1 pokemon.
This commit is contained in:
parent
bb8cad9eff
commit
6f0d3b1681
@ -190,15 +190,14 @@ describe("Berries Abound - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("Should skip battle when fastest pokemon is faster than boss", async () => {
|
it("Should skip battle when fastest pokemon is faster than boss", async () => {
|
||||||
const leaveEncounterWithoutBattleSpy = vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle");
|
vi.spyOn(EncounterPhaseUtils, "leaveEncounterWithoutBattle");
|
||||||
const encounterTextSpy = vi.spyOn(EncounterDialogueUtils, "showEncounterText");
|
vi.spyOn(EncounterDialogueUtils, "showEncounterText");
|
||||||
|
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BERRIES_ABOUND, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BERRIES_ABOUND, defaultParty);
|
||||||
|
|
||||||
// Setting party pokemon's level arbitrarily high to outspeed
|
scene.getParty().forEach(pkm => {
|
||||||
const fastestPokemon = scene.getParty()[0];
|
vi.spyOn(pkm, "getStat").mockReturnValue(9999); // for ease return for every stat
|
||||||
fastestPokemon.level = 1000;
|
});
|
||||||
fastestPokemon.calculateStats();
|
|
||||||
|
|
||||||
await runMysteryEncounterToEnd(game, 2);
|
await runMysteryEncounterToEnd(game, 2);
|
||||||
await game.phaseInterceptor.to(SelectModifierPhase, false);
|
await game.phaseInterceptor.to(SelectModifierPhase, false);
|
||||||
@ -212,8 +211,8 @@ describe("Berries Abound - Mystery Encounter", () => {
|
|||||||
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
expect(option.modifierTypeOption.type.id).toContain("BERRY");
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(encounterTextSpy).toHaveBeenCalledWith(expect.any(BattleScene), `${namespace}.option.2.selected`);
|
expect(EncounterDialogueUtils.showEncounterText).toHaveBeenCalledWith(expect.any(BattleScene), `${namespace}.option.2.selected`);
|
||||||
expect(leaveEncounterWithoutBattleSpy).toBeCalled();
|
expect(EncounterPhaseUtils.leaveEncounterWithoutBattle).toBeCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user