pokerogue/src/test/localization/french.test.ts
NightKev 828897316e
[Test] Replace doAttack() with move.select() in tests (#3567)
* Consolidate `doSelectTarget()` into `doAttack()`

* Fix ternary

* Add error message to aid in debugging tests

* Update docs

* [Test] Change `doAttack()` to `selectMove()`

* Add `select()` to `src/test/utils/helpers/moveHelper.ts`

* Replace instances of `game.selectMove()` with `game.move.select()`

* Fix imports

* Replace `selectMove()` with `move.select()` helper

Fix broken tests for Pastel Veil and Sweet Veil

* Update tsdocs
2024-08-22 06:49:33 -07:00

43 lines
1.1 KiB
TypeScript

import { initI18n } from "#app/plugins/i18n";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import i18next from "i18next";
import Phaser from "phaser";
import { afterEach, beforeAll, describe, expect, it } from "vitest";
describe("Lokalization - french", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
initI18n();
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
it("test bulbasaur name english", async () => {
game = new GameManager(phaserGame);
await game.startBattle([
Species.BULBASAUR,
]);
expect(game.scene.getParty()[0].name).toBe("Bulbasaur");
}, 20000);
it("test bulbasaure name french", async () => {
const locale = "fr";
i18next.changeLanguage(locale);
localStorage.setItem("prLang", locale);
game = new GameManager(phaserGame);
await game.startBattle([
Species.BULBASAUR,
]);
expect(game.scene.getParty()[0].name).toBe("Bulbizarre");
}, 20000);
});