-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-list.js
64 lines (49 loc) · 2.27 KB
/
get-list.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const domain = require("supertest")("http://barru.pythonanywhere.com");
const expect = require("chai").expect;
describe("Scenario List User Feature", function () {
it("1. Verifying Success Get List User by ID", async function () {
const id = "1";
const response = await domain
.get("/list-user")
.query({id})
expect(response.body.status).to.eql('SUCCESS_USER_LIST');
expect(response.body.message).to.eql('List of registered users');
expect(response.body).to.include.keys("data", "message", "pagination", "status");
});
it("2. Verifying Success Get List User by email", async function () {
const email = "boladunia4@gmail.com";
const response = await domain
.get("/list-user")
.query({email})
expect(response.body.status).to.eql('SUCCESS_USER_LIST');
expect(response.body.message).to.eql('List of registered users');
expect(response.body).to.include.keys("data", "message", "pagination", "status");
});
it("3. Verifying Success Get List User by username", async function () {
const username = "bang ganteng";
const response = await domain
.get("/list-user")
.query({username})
expect(response.body.status).to.eql('SUCCESS_USER_LIST');
expect(response.body.message).to.eql('List of registered users');
expect(response.body).to.include.keys("data", "message", "pagination", "status");
});
it("4. Verifying Success Get List User by page", async function () {
const page = "1";
const response = await domain
.get("/list-user")
.query({page})
expect(response.body.status).to.eql('SUCCESS_USER_LIST');
expect(response.body.message).to.eql('List of registered users');
expect(response.body).to.include.keys("data", "message", "pagination", "status");
});
it.only("5. Verifying Success Get List User email", async function () {
const email = "";
const response = await domain
.get("/list-user")
.query({email})
expect(response.body.status).to.eql('SUCCESS_USER_LIST');
expect(response.body.message).to.eql('List of registered users');
expect(response.body).to.include.keys("data", "message", "pagination", "status");
});
});