mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
* Rename `Abilities` to `AbilityId` * Rename `abilities.ts` to `ability-id.ts` * Rename `Moves` to `MoveId` * Rename `moves.ts` to `move-id.ts` * Rename `Species` to `SpeciesId` * Rename `species.ts` to `species-id.ts` * Rename `Biome` to `BiomeId` * Rename `biome.ts` to `biome-id.ts` * Replace `Abilities` with `AbilityId` in comments * Replace `Biome` with `BiomeId` in comments * Replace `Moves` with `MoveId` in comments * Replace `Species` with `SpeciesId` in comments
58 lines
1.6 KiB
TypeScript
58 lines
1.6 KiB
TypeScript
import i18next from "#app/plugins/i18n";
|
|
import { AbilityId } from "#enums/ability-id";
|
|
import { MoveId } from "#enums/move-id";
|
|
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 } from "vitest";
|
|
|
|
describe("Items - Toxic orb", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override
|
|
.battleStyle("single")
|
|
.enemySpecies(SpeciesId.MAGIKARP)
|
|
.ability(AbilityId.BALL_FETCH)
|
|
.enemyAbility(AbilityId.BALL_FETCH)
|
|
.moveset(MoveId.SPLASH)
|
|
.enemyMoveset(MoveId.SPLASH)
|
|
.startingHeldItems([
|
|
{
|
|
name: "TOXIC_ORB",
|
|
},
|
|
]);
|
|
|
|
vi.spyOn(i18next, "t");
|
|
});
|
|
|
|
it("should badly poison the holder", async () => {
|
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
|
|
|
const player = game.scene.getPlayerPokemon()!;
|
|
expect(player.getHeldItems()[0].type.id).toBe("TOXIC_ORB");
|
|
|
|
game.move.select(MoveId.SPLASH);
|
|
|
|
await game.phaseInterceptor.to("TurnEndPhase");
|
|
await game.phaseInterceptor.to("MessagePhase");
|
|
expect(i18next.t).toHaveBeenCalledWith("statusEffect:toxic.obtainSource", expect.anything());
|
|
|
|
expect(player.status?.effect).toBe(StatusEffect.TOXIC);
|
|
expect(player.status?.toxicTurnCount).toBe(0);
|
|
});
|
|
});
|