update egg tests to match latest species egg tier changes

This commit is contained in:
Moka 2024-11-16 17:09:47 +01:00
parent 3d59dda792
commit 830420afdf

View File

@ -1,5 +1,4 @@
import { speciesEggTiers } from "#app/data/balance/species-egg-tiers";
import { speciesStarterCosts } from "#app/data/balance/starters";
import { Egg, getLegendaryGachaSpeciesForTimestamp, getValidLegendaryGachaSpecies } from "#app/data/egg";
import { allSpecies } from "#app/data/pokemon-species";
import { EggSourceType } from "#app/enums/egg-source-types";
@ -33,28 +32,28 @@ describe("Egg Generation Tests", () => {
await game.importData("src/test/utils/saves/everything.prsv");
});
it("should return Arceus for the 10th of June", () => {
it("should return Kyogre for the 10th of June", () => {
const scene = game.scene;
const timestamp = new Date(2024, 5, 10, 15, 0, 0, 0).getTime();
const expectedSpecies = Species.ARCEUS;
const expectedSpecies = Species.KYOGRE;
const result = getLegendaryGachaSpeciesForTimestamp(scene, timestamp);
expect(result).toBe(expectedSpecies);
});
it("should return Arceus for the 10th of July", () => {
it("should return Kyogre for the 10th of July", () => {
const scene = game.scene;
const timestamp = new Date(2024, 6, 10, 15, 0, 0, 0).getTime();
const expectedSpecies = Species.ARCEUS;
const expectedSpecies = Species.KYOGRE;
const result = getLegendaryGachaSpeciesForTimestamp(scene, timestamp);
expect(result).toBe(expectedSpecies);
});
it("should hatch an Arceus around half the time. Set from legendary gacha", async () => {
it("should hatch a Kyogre around half the time. Set from legendary gacha", async () => {
const scene = game.scene;
const timestamp = new Date(2024, 6, 10, 15, 0, 0, 0).getTime();
const expectedSpecies = Species.ARCEUS;
const expectedSpecies = Species.KYOGRE;
let gachaSpeciesCount = 0;
for (let i = 0; i < EGG_HATCH_COUNT; i++) {
@ -385,23 +384,4 @@ describe("Egg Generation Tests", () => {
expect(diffShiny).toBe(true);
expect(diffAbility).toBe(true);
});
// For now, we are using this test to detect oversights in egg tiers.
// Delete this test if the balance team rebalances species costs independently of egg tiers.
it("should have correct egg tiers based on species costs", () => {
const getExpectedEggTier = (starterCost) =>
starterCost <= 3 ? EggTier.COMMON
: starterCost <= 5 ? EggTier.RARE
: starterCost <= 7 ? EggTier.EPIC
: EggTier.LEGENDARY;
allSpecies.forEach(pokemonSpecies => {
const rootSpecies = pokemonSpecies.getRootSpeciesId();
const speciesCost = speciesStarterCosts[rootSpecies];
const expectedEggTier = getExpectedEggTier(speciesCost);
const actualEggTier = speciesEggTiers[rootSpecies];
expect(actualEggTier).toBe(expectedEggTier);
});
});
});