Fix tests
This commit is contained in:
parent
2a2ef7d50c
commit
6373a86011
|
@ -1,10 +1,11 @@
|
||||||
|
import { Abilities } from "#app/enums/abilities";
|
||||||
|
import { Moves } from "#app/enums/moves";
|
||||||
|
import { MapModifier } from "#app/modifier/modifier";
|
||||||
|
import { poolHasBlackHole, poolHasEviolite } from "#app/modifier/modifier-type";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import GameManager from "./utils/gameManager";
|
import GameManager from "./utils/gameManager";
|
||||||
import { MapModifier } from "#app/modifier/modifier.js";
|
|
||||||
import { SelectModifierPhase } from "../phases/select-modifier-phase";
|
const TIMEOUT = 20 * 1000;
|
||||||
import { Moves } from "#app/enums/moves.js";
|
|
||||||
import { Abilities } from "#app/enums/abilities.js";
|
|
||||||
import { poolHasEviolite, poolHasBlackHole } from "#app/modifier/modifier-type.js";
|
|
||||||
|
|
||||||
describe("Daily Mode", () => {
|
describe("Daily Mode", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
|
@ -35,35 +36,46 @@ describe("Daily Mode", () => {
|
||||||
});
|
});
|
||||||
expect(game.scene.getModifiers(MapModifier).length).toBeGreaterThan(0);
|
expect(game.scene.getModifiers(MapModifier).length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Shop modifications", async () => {
|
describe("Shop modifications", async () => {
|
||||||
beforeEach(() => {
|
let phaserGame: Phaser.Game;
|
||||||
game = new GameManager(phaserGame);
|
let game: GameManager;
|
||||||
|
|
||||||
game.override
|
beforeAll(() => {
|
||||||
.battleType("single")
|
phaserGame = new Phaser.Game({
|
||||||
.startingLevel(200)
|
type: Phaser.HEADLESS,
|
||||||
.moveset([Moves.SURF])
|
|
||||||
.enemyAbility(Abilities.BALL_FETCH);
|
|
||||||
});
|
|
||||||
afterEach(() => {
|
|
||||||
game.phaseInterceptor.restoreOg();
|
|
||||||
});
|
|
||||||
it("should only allow Mini Black Hole and Eviolite outside of Daily if unlocked", async () => {
|
|
||||||
await game.classicMode.startBattle();
|
|
||||||
|
|
||||||
game.move.select(Moves.SURF);
|
|
||||||
await game.phaseInterceptor.to(SelectModifierPhase, false);
|
|
||||||
expect(poolHasEviolite).toBeFalsy();
|
|
||||||
expect(poolHasBlackHole).toBeFalsy();
|
|
||||||
});
|
|
||||||
it("should allow Eviolite and Mini Black Hole in shop when in Daily Run", async () => {
|
|
||||||
await game.dailyMode.startBattle();
|
|
||||||
|
|
||||||
game.move.select(Moves.SURF);
|
|
||||||
await game.phaseInterceptor.to(SelectModifierPhase, false);
|
|
||||||
expect(poolHasEviolite).toBeTruthy();
|
|
||||||
expect(poolHasBlackHole).toBeTruthy();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
|
||||||
|
game.override
|
||||||
|
.battleType("single")
|
||||||
|
.startingLevel(200)
|
||||||
|
.moveset([Moves.SURF])
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should only allow Mini Black Hole and Eviolite outside of Daily if unlocked", async () => {
|
||||||
|
await game.classicMode.startBattle();
|
||||||
|
|
||||||
|
game.move.select(Moves.SURF);
|
||||||
|
await game.phaseInterceptor.to("SelectModifierPhase", false);
|
||||||
|
expect(poolHasEviolite).toBeFalsy();
|
||||||
|
expect(poolHasBlackHole).toBeFalsy();
|
||||||
|
}, TIMEOUT);
|
||||||
|
|
||||||
|
it("should allow Eviolite and Mini Black Hole in shop when in Daily Run", async () => {
|
||||||
|
await game.dailyMode.startBattle();
|
||||||
|
|
||||||
|
game.move.select(Moves.SURF);
|
||||||
|
await game.phaseInterceptor.to("SelectModifierPhase", false);
|
||||||
|
expect(poolHasEviolite).toBeTruthy();
|
||||||
|
expect(poolHasBlackHole).toBeTruthy();
|
||||||
|
}, TIMEOUT);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue