Update import for bypassLogin in test

This commit is contained in:
Sirz Benjie 2025-04-14 16:50:47 -05:00
parent 4988d6eb6d
commit bd76a63964
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -1,4 +1,4 @@
import * as BattleScene from "#app/battle-scene"; import * as bypassLoginModule from "#app/global-vars/bypass-login";
import { pokerogueApi } from "#app/plugins/api/pokerogue-api"; import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import type { SessionSaveData } from "#app/system/game-data"; import type { SessionSaveData } from "#app/system/game-data";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
@ -33,13 +33,13 @@ describe("System - Game Data", () => {
describe("tryClearSession", () => { describe("tryClearSession", () => {
beforeEach(() => { beforeEach(() => {
vi.spyOn(BattleScene, "bypassLogin", "get").mockReturnValue(false); vi.spyOn(bypassLoginModule, "bypassLogin", "get").mockReturnValue(false);
vi.spyOn(game.scene.gameData, "getSessionSaveData").mockReturnValue({} as SessionSaveData); vi.spyOn(game.scene.gameData, "getSessionSaveData").mockReturnValue({} as SessionSaveData);
vi.spyOn(account, "updateUserInfo").mockImplementation(async () => [true, 1]); vi.spyOn(account, "updateUserInfo").mockImplementation(async () => [true, 1]);
}); });
it("should return [true, true] if bypassLogin is true", async () => { it("should return [true, true] if bypassLogin is true", async () => {
vi.spyOn(BattleScene, "bypassLogin", "get").mockReturnValue(true); vi.spyOn(bypassLoginModule, "bypassLogin", "get").mockReturnValue(true);
const result = await game.scene.gameData.tryClearSession(0); const result = await game.scene.gameData.tryClearSession(0);