[Test] Fix Safeguard test that relied on a now-fixed bug (#4098)

This commit is contained in:
NightKev 2024-09-09 09:53:45 -07:00 committed by GitHub
parent 3d01e905df
commit 89b33466a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 8 deletions

View File

@ -38,7 +38,7 @@ describe("Moves - Safeguard", () => {
}); });
it("protects from damaging moves with additional effects", async () => { it("protects from damaging moves with additional effects", async () => {
await game.startBattle(); await game.classicMode.startBattle();
const enemy = game.scene.getEnemyPokemon()!; const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.NUZZLE); game.move.select(Moves.NUZZLE);
@ -49,7 +49,7 @@ describe("Moves - Safeguard", () => {
}, TIMEOUT); }, TIMEOUT);
it("protects from status moves", async () => { it("protects from status moves", async () => {
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SPORE); game.move.select(Moves.SPORE);
@ -61,7 +61,7 @@ describe("Moves - Safeguard", () => {
it("protects from confusion", async () => { it("protects from confusion", async () => {
game.override.moveset([Moves.CONFUSE_RAY]); game.override.moveset([Moves.CONFUSE_RAY]);
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.CONFUSE_RAY); game.move.select(Moves.CONFUSE_RAY);
@ -74,7 +74,7 @@ describe("Moves - Safeguard", () => {
it("protects ally from status", async () => { it("protects ally from status", async () => {
game.override.battleType("double"); game.override.battleType("double");
await game.startBattle(); await game.classicMode.startBattle();
game.move.select(Moves.SPORE, 0, BattlerIndex.ENEMY_2); game.move.select(Moves.SPORE, 0, BattlerIndex.ENEMY_2);
game.move.select(Moves.NUZZLE, 1, BattlerIndex.ENEMY_2); game.move.select(Moves.NUZZLE, 1, BattlerIndex.ENEMY_2);
@ -90,7 +90,7 @@ describe("Moves - Safeguard", () => {
}, TIMEOUT); }, TIMEOUT);
it("protects from Yawn", async () => { it("protects from Yawn", async () => {
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.YAWN); game.move.select(Moves.YAWN);
@ -101,7 +101,7 @@ describe("Moves - Safeguard", () => {
}, TIMEOUT); }, TIMEOUT);
it("doesn't protect from already existing Yawn", async () => { it("doesn't protect from already existing Yawn", async () => {
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.YAWN); game.move.select(Moves.YAWN);
@ -116,12 +116,13 @@ describe("Moves - Safeguard", () => {
it("doesn't protect from self-inflicted via Rest or Flame Orb", async () => { it("doesn't protect from self-inflicted via Rest or Flame Orb", async () => {
game.override.enemyHeldItems([{name: "FLAME_ORB"}]); game.override.enemyHeldItems([{name: "FLAME_ORB"}]);
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.toNextTurn(); await game.toNextTurn();
enemyPokemon.damageAndUpdate(1);
expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN); expect(enemyPokemon.status?.effect).toEqual(StatusEffect.BURN);
@ -135,7 +136,7 @@ describe("Moves - Safeguard", () => {
it("protects from ability-inflicted status", async () => { it("protects from ability-inflicted status", async () => {
game.override.ability(Abilities.STATIC); game.override.ability(Abilities.STATIC);
vi.spyOn(allAbilities[Abilities.STATIC].getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0], "chance", "get").mockReturnValue(100); vi.spyOn(allAbilities[Abilities.STATIC].getAttrs(PostDefendContactApplyStatusEffectAbAttr)[0], "chance", "get").mockReturnValue(100);
await game.startBattle(); await game.classicMode.startBattle();
const enemyPokemon = game.scene.getEnemyPokemon()!; const enemyPokemon = game.scene.getEnemyPokemon()!;
game.move.select(Moves.SPLASH); game.move.select(Moves.SPLASH);