From 82b435b29049c216aaf646c9f318e98b949641b4 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:38:11 -0500 Subject: [PATCH] Update mocks for utils in tests --- test/plugins/api/pokerogue-account-api.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/plugins/api/pokerogue-account-api.test.ts b/test/plugins/api/pokerogue-account-api.test.ts index 6abdd96f632..3c37451960a 100644 --- a/test/plugins/api/pokerogue-account-api.test.ts +++ b/test/plugins/api/pokerogue-account-api.test.ts @@ -2,7 +2,7 @@ import type { AccountInfoResponse } from "#app/@types/PokerogueAccountApi"; import { SESSION_ID_COOKIE_NAME } from "#app/constants"; import { PokerogueAccountApi } from "#app/plugins/api/pokerogue-account-api"; import { getApiBaseUrl } from "#test/testUtils/testUtils"; -import * as Utils from "#app/utils/common"; +import * as CookieUtils from "#app/utils/cookies"; import * as cookies from "#app/utils/cookies"; import { http, HttpResponse } from "msw"; import { beforeAll, afterEach, beforeEach, describe, expect, it, vi } from "vitest"; @@ -99,7 +99,7 @@ describe("Pokerogue Account API", () => { const loginParams = { username: "test", password: "test" }; it("should return null and set the cookie on SUCCESS", async () => { - vi.spyOn(Utils, "setCookie"); + vi.spyOn(CookieUtils, "setCookie"); server.use(http.post(`${apiBase}/account/login`, () => HttpResponse.json({ token: "abctest" }))); const error = await accountApi.login(loginParams); @@ -131,11 +131,11 @@ describe("Pokerogue Account API", () => { describe("Logout", () => { beforeEach(() => { - vi.spyOn(Utils, "removeCookie"); + vi.spyOn(CookieUtils, "removeCookie"); }); it("should remove cookie on success", async () => { - vi.spyOn(Utils, "setCookie"); + vi.spyOn(CookieUtils, "setCookie"); server.use(http.get(`${apiBase}/account/logout`, () => new HttpResponse("", { status: 200 }))); await accountApi.logout();