fix mocking the client session

This commit is contained in:
Felix Staud 2024-06-09 15:31:23 -07:00
parent 1a561fa0fd
commit 194a96417b
2 changed files with 23258 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { randInt } from "#app/utils.js"; import { randInt } from "#app/utils.js";
import { http, HttpResponse } from "msw"; import { http, HttpResponse } from "msw";
// import saveData from "./assets/save-data.json"; import systemClientSession from "./data/system-client-session.json";
export const handlers = [ export const handlers = [
http.post("https://api.pokerogue.net/account/login", async () => { http.post("https://api.pokerogue.net/account/login", async () => {
@ -14,7 +14,7 @@ export const handlers = [
}); });
}), }),
http.get("https://api.pokerogue.net/savedata/system", async () => { http.get("https://api.pokerogue.net/savedata/system", async () => {
return HttpResponse.json({}); return HttpResponse.json(systemClientSession);
}), }),
http.get("https://api.pokerogue.net/savedata/session", async () => { http.get("https://api.pokerogue.net/savedata/session", async () => {
return HttpResponse.text(); return HttpResponse.text();