Update test with new function definition

This commit is contained in:
NightKev 2024-08-09 13:12:41 -07:00
parent 2fa7ac9ab8
commit 1462d45480

View File

@ -7,7 +7,6 @@ import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle.js";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities.js";
import { mockTurnOrder } from "../utils/testUtils";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect.js";
import { allAbilities, PostDefendContactApplyStatusEffectAbAttr } from "#app/data/ability.js"; import { allAbilities, PostDefendContactApplyStatusEffectAbAttr } from "#app/data/ability.js";
@ -46,7 +45,7 @@ describe("Moves - Safeguard", () => {
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.NUZZLE)); game.doAttack(getMovePosition(game.scene, 0, Moves.NUZZLE));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemy.status).toBeUndefined(); expect(enemy.status).toBeUndefined();
@ -59,7 +58,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.SPORE)); game.doAttack(getMovePosition(game.scene, 0, Moves.SPORE));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status).toBeUndefined(); expect(enemyPokemon.status).toBeUndefined();
@ -73,7 +72,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.CONFUSE_RAY)); game.doAttack(getMovePosition(game.scene, 0, Moves.CONFUSE_RAY));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.summonData.tags).toEqual([]); expect(enemyPokemon.summonData.tags).toEqual([]);
@ -96,7 +95,7 @@ describe("Moves - Safeguard", () => {
await game.phaseInterceptor.to(SelectTargetPhase, false); await game.phaseInterceptor.to(SelectTargetPhase, false);
game.doSelectTarget(BattlerIndex.ENEMY_2); game.doSelectTarget(BattlerIndex.ENEMY_2);
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2]);
await game.phaseInterceptor.to(TurnEndPhase); await game.phaseInterceptor.to(TurnEndPhase);
@ -113,7 +112,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.YAWN)); game.doAttack(getMovePosition(game.scene, 0, Moves.YAWN));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.summonData.tags).toEqual([]); expect(enemyPokemon.summonData.tags).toEqual([]);
@ -126,7 +125,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.YAWN)); game.doAttack(getMovePosition(game.scene, 0, Moves.YAWN));
await mockTurnOrder(game, [BattlerIndex.PLAYER, BattlerIndex.ENEMY]); await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
await game.toNextTurn(); await game.toNextTurn();
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
@ -143,7 +142,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN); expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN);
@ -164,7 +163,7 @@ describe("Moves - Safeguard", () => {
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
await mockTurnOrder(game, [BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
game.override.enemyMoveset(Array(4).fill(Moves.TACKLE)); game.override.enemyMoveset(Array(4).fill(Moves.TACKLE));
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH)); game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));