Skip to content

Commit ba25b02

Browse files
Fix issue #4735: Update msw mocks (#4736)
1 parent 966da7b commit ba25b02

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

frontend/src/mocks/handlers.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { delay, http, HttpResponse } from "msw";
22

33
const openHandsHandlers = [
4-
http.get("http://localhost:3000/api/options/models", async () => {
4+
http.get("http://localhost:3001/api/options/models", async () => {
55
await delay();
66
return HttpResponse.json([
77
"gpt-3.5-turbo",
@@ -10,17 +10,17 @@ const openHandsHandlers = [
1010
]);
1111
}),
1212

13-
http.get("http://localhost:3000/api/options/agents", async () => {
13+
http.get("http://localhost:3001/api/options/agents", async () => {
1414
await delay();
1515
return HttpResponse.json(["CodeActAgent", "CoActAgent"]);
1616
}),
1717

18-
http.get("http://localhost:3000/api/options/security-analyzers", async () => {
18+
http.get("http://localhost:3001/api/options/security-analyzers", async () => {
1919
await delay();
2020
return HttpResponse.json(["mock-invariant"]);
2121
}),
2222

23-
http.get("http://localhost:3000/api/list-files", async ({ request }) => {
23+
http.get("http://localhost:3001/api/list-files", async ({ request }) => {
2424
await delay();
2525

2626
const token = request.headers
@@ -32,11 +32,11 @@ const openHandsHandlers = [
3232
return HttpResponse.json(["file1.ts", "dir1/file2.ts", "file3.ts"]);
3333
}),
3434

35-
http.post("http://localhost:3000/api/save-file", () =>
35+
http.post("http://localhost:3001/api/save-file", () =>
3636
HttpResponse.json(null, { status: 200 }),
3737
),
3838

39-
http.get("http://localhost:3000/api/select-file", async ({ request }) => {
39+
http.get("http://localhost:3001/api/select-file", async ({ request }) => {
4040
await delay();
4141

4242
const token = request.headers
@@ -58,7 +58,7 @@ const openHandsHandlers = [
5858
return HttpResponse.json(null, { status: 404 });
5959
}),
6060

61-
http.post("http://localhost:3000/api/submit-feedback", async () => {
61+
http.post("http://localhost:3001/api/submit-feedback", async () => {
6262
await delay(1200);
6363

6464
return HttpResponse.json({
@@ -87,7 +87,10 @@ export const handlers = [
8787
{ id: 2, full_name: "octocat/earth" },
8888
]);
8989
}),
90-
http.post("http://localhost:3000/api/submit-feedback", async () =>
90+
http.post("http://localhost:3001/api/submit-feedback", async () =>
9191
HttpResponse.json({ statusCode: 200 }, { status: 200 }),
9292
),
93+
http.post("https://us.i.posthog.com/e", async () =>
94+
HttpResponse.json(null, { status: 200 }),
95+
),
9396
];

0 commit comments

Comments
 (0)