summary refs log tree commit diff
path: root/api/tests/routes
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 22:18:59 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-22 22:18:59 +1000
commit0cd9a46eea260c299db2e2983f7214ab8b119d29 (patch)
tree5fbb98e7adcfeab81594732089474afdde5893f9 /api/tests/routes
parentMerge branch 'master' into feat/captchaVerify (diff)
parentMerge remote-tracking branch 'Puyodead1/patch/prettier-config' into staging (diff)
downloadserver-0cd9a46eea260c299db2e2983f7214ab8b119d29.tar.xz
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to 'api/tests/routes')
-rw-r--r--api/tests/routes/auth/login.test.js33
-rw-r--r--api/tests/routes/auth/register.test.js27
-rw-r--r--api/tests/routes/ping.test.js12
3 files changed, 0 insertions, 72 deletions
diff --git a/api/tests/routes/auth/login.test.js b/api/tests/routes/auth/login.test.js
deleted file mode 100644

index d4b52444..00000000 --- a/api/tests/routes/auth/login.test.js +++ /dev/null
@@ -1,33 +0,0 @@ -const supertest = require("supertest"); -const request = supertest("http://localhost:3001"); - -describe("/api/auth/login", () => { - describe("POST", () => { - test("without body", async () => { - const response = await request.post("/api/auth/login").send({}); - expect(response.statusCode).toBe(400); - }); - test("with body", async () => { - const user = { - login: "fortnitefortnite@gmail.com", - password: "verysecurepassword" - }; - - await request.post("/api/auth/register").send({ - fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", - email: user.login, - username: user.login.split("@")[0], - password: user.password, - invite: null, - consent: true, - date_of_birth: "2000-04-04", - gift_code_sku_id: null, - captcha_key: null - }); - - const response = await request.post("/api/auth/login").send(user); - - expect(response.statusCode).toBe(200); - }); - }); -}); diff --git a/api/tests/routes/auth/register.test.js b/api/tests/routes/auth/register.test.js deleted file mode 100644
index 5d7b4eaa..00000000 --- a/api/tests/routes/auth/register.test.js +++ /dev/null
@@ -1,27 +0,0 @@ -const supertest = require("supertest"); -const request = supertest("http://localhost:3001"); - -describe("/api/auth/register", () => { - describe("POST", () => { - test("without body", async () => { - const response = await request.post("/api/auth/register").send({}); - - expect(response.statusCode).toBe(400); - }); - test("with body", async () => { - const response = await request.post("/api/auth/register").send({ - fingerprint: "805826570869932034.wR8vi8lGlFBJerErO9LG5NViJFw", - email: "qo8etzvaf@gmail.com", - username: "qp39gr98", - password: "wtp9gep9gw", - invite: null, - consent: true, - date_of_birth: "2000-04-04", - gift_code_sku_id: null, - captcha_key: null - }); - - expect(response.statusCode).toBe(200); - }); - }); -}); diff --git a/api/tests/routes/ping.test.js b/api/tests/routes/ping.test.js deleted file mode 100644
index 6fa4b160..00000000 --- a/api/tests/routes/ping.test.js +++ /dev/null
@@ -1,12 +0,0 @@ -const supertest = require("supertest"); -const request = supertest("http://localhost:3001"); - -describe("/ping", () => { - describe("GET", () => { - test("should return 200 and pong", async () => { - let response = await request.get("/api/ping"); - expect(response.text).toBe("pong"); - expect(response.statusCode).toBe(200); - }); - }); -});