-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.test.js
More file actions
26 lines (21 loc) · 721 Bytes
/
post.test.js
File metadata and controls
26 lines (21 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import orchestrator from "tests/orchestrator.js";
beforeAll(async () => {
await orchestrator.waitForAllServices();
});
describe("POST to api/v1/status", () => {
describe("Anonymous user", () => {
test("Trying a not allowed POST method", async () => {
const response = await fetch("http://localhost:3000/api/v1/status", {
method: "POST",
});
expect(response.status).toBe(405);
const responseBody = await response.json();
expect(responseBody).toEqual({
name: "MethodNotAllowedError",
message: "Method not allowed for this endpoint.",
action: "Try using another HTTP method for this endpoint.",
status_code: 405,
});
});
});
});