From 68f7723c231e00eac0fc34387cd768f87d34a126 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:47:13 -0700 Subject: [PATCH] fix: tests that have to use the i18next key now instead of the english translation --- src/test/abilities/ability_timing.test.ts | 2 +- src/test/items/toxic_orb.test.ts | 5 +- .../a-trainers-test-encounter.test.ts | 2 +- ...an-offer-you-cant-refuse-encounter.test.ts | 4 +- .../encounters/field-trip-encounter.test.ts | 33 +++---- .../fiery-fallout-encounter.test.ts | 2 +- .../encounters/lost-at-sea-encounter.test.ts | 4 +- .../teleporting-hijinks-encounter.test.ts | 4 +- .../mystery-encounter-utils.test.ts | 10 +-- .../phases/mystery-encounter-phase.test.ts | 17 ++-- src/test/ui/starter-select.test.ts | 90 +++++++++---------- src/test/ui/type-hints.test.ts | 4 +- 12 files changed, 90 insertions(+), 87 deletions(-) diff --git a/src/test/abilities/ability_timing.test.ts b/src/test/abilities/ability_timing.test.ts index fb3d3af1a6b..16437df06c9 100644 --- a/src/test/abilities/ability_timing.test.ts +++ b/src/test/abilities/ability_timing.test.ts @@ -47,6 +47,6 @@ describe("Ability Timing", () => { await game.phaseInterceptor.to("MessagePhase"); const message = game.textInterceptor.getLatestMessage(); - expect(message).toContain("Attack fell"); + expect(message).toContain("battle:statFell"); }, 5000); }); diff --git a/src/test/items/toxic_orb.test.ts b/src/test/items/toxic_orb.test.ts index 95336c0793e..66806083f6f 100644 --- a/src/test/items/toxic_orb.test.ts +++ b/src/test/items/toxic_orb.test.ts @@ -58,11 +58,10 @@ describe("Items - Toxic orb", () => { // Toxic orb should trigger here await game.phaseInterceptor.run(MessagePhase); const message = game.textInterceptor.getLatestMessage(); - expect(message).toContain("was badly poisoned by the Toxic Orb"); + expect(message).toContain("statusEffect:toxic.obtainSource"); await game.phaseInterceptor.run(MessagePhase); const message2 = game.textInterceptor.getLatestMessage(); - expect(message2).toContain("is hurt"); - expect(message2).toContain("by poison"); + expect(message2).toBe("statusEffect:toxic.activation"); expect(game.scene.getParty()[0].status!.effect).toBe(StatusEffect.TOXIC); }, 20000); }); diff --git a/src/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts b/src/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts index b4cc186864c..0b1fd0c1050 100644 --- a/src/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/a-trainers-test-encounter.test.ts @@ -122,7 +122,7 @@ describe("A Trainer's Test - Mystery Encounter", () => { expect(scene.getCurrentPhase()?.constructor.name).toBe(CommandPhase.name); expect(enemyField.length).toBe(1); expect(scene.currentBattle.trainer).toBeDefined(); - expect(["buck", "cheryl", "marley", "mira", "riley"].includes(scene.currentBattle.trainer!.config.name.toLowerCase())).toBeTruthy(); + expect(["trainerNames:buck", "trainerNames:cheryl", "trainerNames:marley", "trainerNames:mira", "trainerNames:riley"].includes(scene.currentBattle.trainer!.config.name)).toBeTruthy(); expect(enemyField[0]).toBeDefined(); }); diff --git a/src/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts b/src/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts index 1c68852a63d..ee1c02b0713 100644 --- a/src/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/an-offer-you-cant-refuse-encounter.test.ts @@ -109,8 +109,8 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => { expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.strongestPokemon).toBeDefined(); expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.price).toBeDefined(); - expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.option2PrimaryAbility).toBe("Intimidate"); - expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.moveOrAbility).toBe("Intimidate"); + expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.option2PrimaryAbility).toBe("ability:intimidate.name"); + expect(AnOfferYouCantRefuseEncounter.dialogueTokens?.moveOrAbility).toBe("ability:intimidate.name"); expect(AnOfferYouCantRefuseEncounter.misc.pokemon instanceof PlayerPokemon).toBeTruthy(); expect(AnOfferYouCantRefuseEncounter.misc?.price?.toString()).toBe(AnOfferYouCantRefuseEncounter.dialogueTokens?.price); expect(onInitResult).toBe(true); diff --git a/src/test/mystery-encounter/encounters/field-trip-encounter.test.ts b/src/test/mystery-encounter/encounters/field-trip-encounter.test.ts index 7a8d951c5da..72c12aeff55 100644 --- a/src/test/mystery-encounter/encounters/field-trip-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/field-trip-encounter.test.ts @@ -14,6 +14,7 @@ import { Moves } from "#enums/moves"; import { SelectModifierPhase } from "#app/phases/select-modifier-phase"; import { Mode } from "#app/ui/ui"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; +import i18next from "i18next"; const namespace = "mysteryEncounter:fieldTrip"; const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.ABRA]; @@ -118,11 +119,11 @@ describe("Field Trip - Mystery Encounter", () => { expect(scene.ui.getMode()).to.equal(Mode.MODIFIER_SELECT); const modifierSelectHandler = scene.ui.handlers.find(h => h instanceof ModifierSelectUiHandler) as ModifierSelectUiHandler; expect(modifierSelectHandler.options.length).toEqual(5); - expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("X Attack"); - expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("X Defense"); - expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("X Speed"); - expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("Dire Hit"); - expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("Rarer Candy"); + expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_attack"); + expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_defense"); + expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_speed"); + expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("modifierType:ModifierType.DIRE_HIT.name"); + expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("modifierType:ModifierType.RARER_CANDY.name"); }); it("should leave encounter without battle", async () => { @@ -165,11 +166,11 @@ describe("Field Trip - Mystery Encounter", () => { expect(scene.ui.getMode()).to.equal(Mode.MODIFIER_SELECT); const modifierSelectHandler = scene.ui.handlers.find(h => h instanceof ModifierSelectUiHandler) as ModifierSelectUiHandler; expect(modifierSelectHandler.options.length).toEqual(5); - expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("X Sp. Atk"); - expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("X Sp. Def"); - expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("X Speed"); - expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("Dire Hit"); - expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("Rarer Candy"); + expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_sp_atk"); + expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_sp_def"); + expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_speed"); + expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("modifierType:ModifierType.DIRE_HIT.name"); + expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("modifierType:ModifierType.RARER_CANDY.name"); }); it("should leave encounter without battle", async () => { @@ -205,6 +206,7 @@ describe("Field Trip - Mystery Encounter", () => { }); it("Should give proper rewards on correct Special move option", async () => { + vi.spyOn(i18next, "t"); await game.runToMysteryEncounter(MysteryEncounterType.FIELD_TRIP, defaultParty); await runMysteryEncounterToEnd(game, 3, { pokemonNo: 1, optionNo: 3 }); await game.phaseInterceptor.to(SelectModifierPhase); @@ -212,11 +214,12 @@ describe("Field Trip - Mystery Encounter", () => { expect(scene.ui.getMode()).to.equal(Mode.MODIFIER_SELECT); const modifierSelectHandler = scene.ui.handlers.find(h => h instanceof ModifierSelectUiHandler) as ModifierSelectUiHandler; expect(modifierSelectHandler.options.length).toEqual(5); - expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("X Accuracy"); - expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("X Speed"); - expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("5x Great Ball"); - expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("IV Scanner"); - expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("Rarer Candy"); + expect(modifierSelectHandler.options[0].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_accuracy"); + expect(modifierSelectHandler.options[1].modifierTypeOption.type.name).toBe("modifierType:TempStatStageBoosterItem.x_speed"); + expect(modifierSelectHandler.options[2].modifierTypeOption.type.name).toBe("modifierType:ModifierType.AddPokeballModifierType.name"); + expect(i18next.t).toHaveBeenCalledWith("modifierType:ModifierType.AddPokeballModifierType.name", expect.objectContaining({ modifierCount: 5 })); + expect(modifierSelectHandler.options[3].modifierTypeOption.type.name).toBe("modifierType:ModifierType.IV_SCANNER.name"); + expect(modifierSelectHandler.options[4].modifierTypeOption.type.name).toBe("modifierType:ModifierType.RARER_CANDY.name"); }); it("should leave encounter without battle", async () => { diff --git a/src/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts b/src/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts index 445ab4491a4..3b7d13e0df1 100644 --- a/src/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/fiery-fallout-encounter.test.ts @@ -213,7 +213,7 @@ describe("Fiery Fallout - Mystery Encounter", () => { const burnablePokemon = party.filter((pkm) => pkm.isAllowedInBattle() && !pkm.getTypes().includes(Type.FIRE)); const notBurnablePokemon = party.filter((pkm) => !pkm.isAllowedInBattle() || pkm.getTypes().includes(Type.FIRE)); - expect(scene.currentBattle.mysteryEncounter?.dialogueTokens["burnedPokemon"]).toBe("Gengar"); + expect(scene.currentBattle.mysteryEncounter?.dialogueTokens["burnedPokemon"]).toBe("pokemon:gengar"); burnablePokemon.forEach((pkm) => { expect(pkm.hp, `${pkm.name} should have received 20% damage: ${pkm.hp} / ${pkm.getMaxHp()} HP`).toBe(pkm.getMaxHp() - Math.floor(pkm.getMaxHp() * 0.2)); }); diff --git a/src/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts b/src/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts index 82670e32daa..408795ad000 100644 --- a/src/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/lost-at-sea-encounter.test.ts @@ -102,8 +102,8 @@ describe("Lost at Sea - Mystery Encounter", () => { const onInitResult = onInit!(scene); expect(LostAtSeaEncounter.dialogueTokens?.damagePercentage).toBe("25"); - expect(LostAtSeaEncounter.dialogueTokens?.option1RequiredMove).toBe("Surf"); - expect(LostAtSeaEncounter.dialogueTokens?.option2RequiredMove).toBe("Fly"); + expect(LostAtSeaEncounter.dialogueTokens?.option1RequiredMove).toBe("move:surf.name"); + expect(LostAtSeaEncounter.dialogueTokens?.option2RequiredMove).toBe("move:fly.name"); expect(onInitResult).toBe(true); }); diff --git a/src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts b/src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts index 2505f28aa43..ab63f4dbb84 100644 --- a/src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts +++ b/src/test/mystery-encounter/encounters/teleporting-hijinks-encounter.test.ts @@ -294,8 +294,8 @@ describe("Teleporting Hijinks - Mystery Encounter", () => { expect(scene.ui.getMode()).to.equal(Mode.MODIFIER_SELECT); const modifierSelectHandler = scene.ui.handlers.find(h => h instanceof ModifierSelectUiHandler) as ModifierSelectUiHandler; - expect(modifierSelectHandler.options.some(opt => opt.modifierTypeOption.type.name === "Metal Coat")).toBe(true); - expect(modifierSelectHandler.options.some(opt => opt.modifierTypeOption.type.name === "Magnet")).toBe(true); + expect(modifierSelectHandler.options.some(opt => opt.modifierTypeOption.type.name === "modifierType:AttackTypeBoosterItem.metal_coat")).toBe(true); + expect(modifierSelectHandler.options.some(opt => opt.modifierTypeOption.type.name === "modifierType:AttackTypeBoosterItem.magnet")).toBe(true); }); }); }); diff --git a/src/test/mystery-encounter/mystery-encounter-utils.test.ts b/src/test/mystery-encounter/mystery-encounter-utils.test.ts index 61eb1eaffd1..1884c1ebc1b 100644 --- a/src/test/mystery-encounter/mystery-encounter-utils.test.ts +++ b/src/test/mystery-encounter/mystery-encounter-utils.test.ts @@ -254,7 +254,7 @@ describe("Mystery Encounter Utils", () => { scene.currentBattle.mysteryEncounter.setDialogueToken("test", "value"); const result = getEncounterText(scene, "mysteryEncounter:unit_test_dialogue"); - expect(result).toEqual("valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}"); + expect(result).toEqual("mysteryEncounter:unit_test_dialogue"); }); it("can perform nested dialogue token injection", () => { @@ -263,7 +263,7 @@ describe("Mystery Encounter Utils", () => { scene.currentBattle.mysteryEncounter.setDialogueToken("testvalue", "new"); const result = getEncounterText(scene, "mysteryEncounter:unit_test_dialogue"); - expect(result).toEqual("valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}"); + expect(result).toEqual("mysteryEncounter:unit_test_dialogue"); }); }); @@ -275,7 +275,7 @@ describe("Mystery Encounter Utils", () => { const phaseSpy = vi.spyOn(game.scene, "unshiftPhase"); queueEncounterMessage(scene, "mysteryEncounter:unit_test_dialogue"); - expect(spy).toHaveBeenCalledWith("valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}", null, true); + expect(spy).toHaveBeenCalledWith("mysteryEncounter:unit_test_dialogue", null, true); expect(phaseSpy).toHaveBeenCalledWith(expect.any(MessagePhase)); }); }); @@ -287,7 +287,7 @@ describe("Mystery Encounter Utils", () => { const spy = vi.spyOn(game.scene.ui, "showText"); await showEncounterText(scene, "mysteryEncounter:unit_test_dialogue"); - expect(spy).toHaveBeenCalledWith("valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}", null, expect.any(Function), 0, true, null); + expect(spy).toHaveBeenCalledWith("mysteryEncounter:unit_test_dialogue", null, expect.any(Function), 0, true, null); }); }); @@ -298,7 +298,7 @@ describe("Mystery Encounter Utils", () => { const spy = vi.spyOn(game.scene.ui, "showDialogue"); await showEncounterDialogue(scene, "mysteryEncounter:unit_test_dialogue", "mysteryEncounter:unit_test_dialogue"); - expect(spy).toHaveBeenCalledWith("valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}", "valuevalue {{testvalue}} {{test1}} {{test}} {{test\\}} {{test\\}} {test}}", null, expect.any(Function), 0); + expect(spy).toHaveBeenCalledWith("mysteryEncounter:unit_test_dialogue", "mysteryEncounter:unit_test_dialogue", null, expect.any(Function), 0); }); }); diff --git a/src/test/phases/mystery-encounter-phase.test.ts b/src/test/phases/mystery-encounter-phase.test.ts index 0a99cd00db3..02f62d4f04b 100644 --- a/src/test/phases/mystery-encounter-phase.test.ts +++ b/src/test/phases/mystery-encounter-phase.test.ts @@ -56,8 +56,9 @@ describe("Mystery Encounter Phases", () => { }); it("Selects an option for MysteryEncounterPhase", async() => { - const dialogueSpy = vi.spyOn(game.scene.ui, "showDialogue"); - const messageSpy = vi.spyOn(game.scene.ui, "showText"); + const { ui } = game.scene; + vi.spyOn(ui, "showDialogue"); + vi.spyOn(ui, "showText"); await game.runToMysteryEncounter(MysteryEncounterType.MYSTERIOUS_CHALLENGERS, [Species.CHARIZARD, Species.VOLCARONA]); game.onNextPrompt("MysteryEncounterPhase", Mode.MESSAGE, () => { @@ -74,12 +75,12 @@ describe("Mystery Encounter Phases", () => { // Waitfor required so that option select messages and preOptionPhase logic are handled await vi.waitFor(() => expect(game.scene.getCurrentPhase()?.constructor.name).toBe(MysteryEncounterOptionSelectedPhase.name)); - expect(game.scene.ui.getMode()).toBe(Mode.MESSAGE); - expect(dialogueSpy).toHaveBeenCalledTimes(1); - expect(messageSpy).toHaveBeenCalledTimes(2); - expect(dialogueSpy).toHaveBeenCalledWith("What's this?", "???", null, expect.any(Function)); - expect(messageSpy).toHaveBeenCalledWith("Mysterious challengers have appeared!", null, expect.any(Function), 750, true); - expect(messageSpy).toHaveBeenCalledWith("The trainer steps forward...", null, expect.any(Function), 300, true); + expect(ui.getMode()).toBe(Mode.MESSAGE); + expect(ui.showDialogue).toHaveBeenCalledTimes(1); + expect(ui.showText).toHaveBeenCalledTimes(2); + expect(ui.showDialogue).toHaveBeenCalledWith("battle:mysteryEncounterAppeared", "???", null, expect.any(Function)); + expect(ui.showText).toHaveBeenCalledWith("mysteryEncounter:mysteriousChallengers.intro", null, expect.any(Function), 750, true); + expect(ui.showText).toHaveBeenCalledWith("mysteryEncounter:mysteriousChallengers.option.selected", null, expect.any(Function), 300, true); }); }); diff --git a/src/test/ui/starter-select.test.ts b/src/test/ui/starter-select.test.ts index 6d26ebfd6b3..dd0761be392 100644 --- a/src/test/ui/starter-select.test.ts +++ b/src/test/ui/starter-select.test.ts @@ -66,11 +66,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -127,11 +127,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -191,11 +191,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -254,11 +254,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -315,11 +315,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -376,11 +376,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -436,11 +436,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); await new Promise((resolve) => { @@ -496,11 +496,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); let starterSelectUiHandler: StarterSelectUiHandler; @@ -561,11 +561,11 @@ describe("UI - Starter select", () => { resolve(); }); }); - expect(options.some(option => option.label === "Add to Party")).toBe(true); - expect(options.some(option => option.label === "Toggle IVs")).toBe(true); - expect(options.some(option => option.label === "Manage Moves")).toBe(true); - expect(options.some(option => option.label === "Use Candies")).toBe(true); - expect(options.some(option => option.label === "Cancel")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:addToParty")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:toggleIVs")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:manageMoves")).toBe(true); + expect(options.some(option => option.label === "starterSelectUiHandler:useCandies")).toBe(true); + expect(options.some(option => option.label === "menu:cancel")).toBe(true); optionSelectUiHandler?.processInput(Button.ACTION); let starterSelectUiHandler: StarterSelectUiHandler | undefined; diff --git a/src/test/ui/type-hints.test.ts b/src/test/ui/type-hints.test.ts index 726094b258a..82209859fb0 100644 --- a/src/test/ui/type-hints.test.ts +++ b/src/test/ui/type-hints.test.ts @@ -53,7 +53,7 @@ describe("UI - Type Hints", () => { const movesContainer = ui.getByName(FightUiHandler.MOVES_CONTAINER_NAME); const dragonClawText = movesContainer .getAll() - .find((text) => text.text === "Dragon Claw")! as unknown as MockText; + .find((text) => text.text === "move:dragonClaw.name")! as unknown as MockText; expect.soft(dragonClawText.color).toBe("#929292"); ui.getHandler().processInput(Button.ACTION); @@ -78,7 +78,7 @@ describe("UI - Type Hints", () => { const movesContainer = ui.getByName(FightUiHandler.MOVES_CONTAINER_NAME); const growlText = movesContainer .getAll() - .find((text) => text.text === "Growl")! as unknown as MockText; + .find((text) => text.text === "move:growl.name")! as unknown as MockText; expect.soft(growlText.color).toBe(undefined); ui.getHandler().processInput(Button.ACTION);