-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproduct.test.ts
29 lines (28 loc) · 953 Bytes
/
product.test.ts
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
27
28
29
import supertest from "supertest";
import createServer from "../../utils/server";
/* eslint-disable @typescript-eslint/no-explicit-any */
const app = createServer();
let token;
beforeAll(async () => {
const res = await supertest(app).post("/login").send({
password: "adminpass",
});
token = res.body.token;
}, 40000);
describe("Seller Collection", () => {
describe("Seller update product availability", () => {
test("Seller update non-existing product", async () => {
const response = await supertest(app).patch(
"/products/delete/72753"
);
expect(response.status).toBe(404);
}, 60000);
test("unauthorised access", async () => {
const response = await supertest(app).patch(
"/products/delete/72753"
);
expect(response.status).toBe(404);
}, 60000);
});
});