[Unittest] Prevent Arena Trap/etc from breaking Costar test (#2923)
This commit is contained in:
parent
f9327680dd
commit
458245f542
|
@ -29,7 +29,7 @@ describe("Abilities - COSTAR", () => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
vi.spyOn(Overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
|
vi.spyOn(Overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
|
||||||
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COSTAR);
|
vi.spyOn(Overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.COSTAR);
|
||||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT, Moves.CURSE]);
|
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.NASTY_PLOT]);
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH, Moves.SPLASH, Moves.SPLASH, Moves.SPLASH]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -37,15 +37,17 @@ describe("Abilities - COSTAR", () => {
|
||||||
test(
|
test(
|
||||||
"ability copies positive stat changes",
|
"ability copies positive stat changes",
|
||||||
async () => {
|
async () => {
|
||||||
|
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.BALL_FETCH);
|
||||||
|
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||||
|
|
||||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||||
expect(leftPokemon).not.toBe(undefined);
|
expect(leftPokemon).toBeDefined();
|
||||||
expect(rightPokemon).not.toBe(undefined);
|
expect(rightPokemon).toBeDefined();
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.NASTY_PLOT));
|
game.doAttack(getMovePosition(game.scene, 0, Moves.NASTY_PLOT));
|
||||||
await game.phaseInterceptor.to(CommandPhase);
|
await game.phaseInterceptor.to(CommandPhase);
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
game.doAttack(getMovePosition(game.scene, 1, Moves.SPLASH));
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(leftPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2);
|
expect(leftPokemon.summonData.battleStats[BattleStat.SPATK]).toBe(+2);
|
||||||
|
@ -71,8 +73,8 @@ describe("Abilities - COSTAR", () => {
|
||||||
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
await game.startBattle([Species.MAGIKARP, Species.MAGIKARP, Species.FLAMIGO]);
|
||||||
|
|
||||||
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
let [leftPokemon, rightPokemon] = game.scene.getPlayerField();
|
||||||
expect(leftPokemon).not.toBe(undefined);
|
expect(leftPokemon).toBeDefined();
|
||||||
expect(rightPokemon).not.toBe(undefined);
|
expect(rightPokemon).toBeDefined();
|
||||||
|
|
||||||
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
||||||
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
expect(leftPokemon.summonData.battleStats[BattleStat.ATK]).toBe(-2);
|
||||||
|
|
Loading…
Reference in New Issue