Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require("supertest");
- const app = require("../app");
- describe("Customer", function() {
- let data = {
- username: "test35",
- password: "Aa123456",
- firstname: "Alexander",
- lastname: "Zero",
- birthdate: "01",
- birthmonth: "12",
- birthyear: "2000",
- address: "London",
- phone: "0888888888",
- email: "e@mail.com"
- };
- it("update customer profile", function(done) {
- request(app)
- .post("/api/customer/updateProfile")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "test35"
- };
- it("verify customer identity", function(done) {
- request(app)
- .post("/api/customer/verifyIdentity")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("customer detail", function(done) {
- request(app)
- .post("/api/customer/detail")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("customer rating", function(done) {
- request(app)
- .post("/api/customer/review")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "test35",
- password: "Aa123456"
- };
- it("customer login", function(done) {
- request(app)
- .post("/api/customer/login")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "test35",
- password: "Aa123456",
- firstname: "Alexander",
- lastname: "Zero",
- birthdate: "01",
- birthmonth: "12",
- birthyear: "2000",
- address: "London",
- phone: "0888888888",
- email: "e@mail.com"
- };
- it("customer signup", function(done) {
- request(app)
- .post("/api/customer/signup")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });
- describe("Driver", function() {
- let data = {
- username: "driver5",
- password: "12345678",
- firstname: "Alexander",
- lastname: "Zero",
- birthdate: "01",
- birthmonth: "12",
- birthyear: "2000",
- address: "London",
- phone: "0888888888",
- email: "e@mail.com"
- };
- it("update driver profile", function(done) {
- request(app)
- .post("/api/driver/updateProfile")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "driver5"
- };
- it("verify driver identity", function(done) {
- request(app)
- .post("/api/driver/verifyIdentity")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("driver detail", function(done) {
- request(app)
- .post("/api/driver/detail")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("driver rating", function(done) {
- request(app)
- .post("/api/driver/review")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "driver5",
- password: "12345678"
- };
- it("driver login", function(done) {
- request(app)
- .post("/api/driver/login")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- data = {
- username: "driver5",
- password: "12345678",
- firstname: "Alexander",
- lastname: "Zero",
- birthdate: "01",
- birthmonth: "12",
- birthyear: "2000",
- address: "London",
- phone: "0888888888",
- email: "e@mail.com"
- };
- it("driver signup", function(done) {
- request(app)
- .post("/api/driver/signup")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });
- describe("Offers", function() {
- let data = {
- price: "50",
- starting_point: "Bangkok",
- destination: "London",
- start_date: "2018-11-01 00:00:00",
- end_date: "2018-11-05 00:00:00",
- car_brand: "BMW",
- car_model: "Z4",
- car_capacity: "5",
- addition_rule: "",
- driver_username: "Driver5"
- };
- it("add offer", function(done) {
- request(app)
- .post("/api/offers/addoffer")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("search offer", function(done) {
- request(app)
- .post("/api/offers/search")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- it("view offer", function(done) {
- request(app)
- .get("/api/offers/:offer_id")
- .set("Accept", "application/json")
- .expect("Content-Type", /json/)
- .expect(200, done);
- });
- data = {
- offer_id: "1"
- };
- it("delete offer", function(done) {
- request(app)
- .delete("/api/offers/:offer_id")
- .send(data)
- .set("Accept", "application/json")
- .expect("Content-Type", /json/)
- .expect(200, done);
- });
- it("my offer", function(done) {
- request(app)
- .get("/api/offers/myoffers")
- .set("Accept", "application/json")
- .expect("Content-Type", /json/)
- .expect(200, done);
- });
- });
- describe("Service", function() {
- let data = {
- service_id: "22",
- driver_username: "driver2"
- };
- it("confirm as driver", function(done) {
- request(app)
- .post("/api/service/confirmasdriver")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });
- /*describe("Offers", function() {
- let data = {
- price: "50",
- starting_point: "Bangkok",
- destination: "London",
- start_date: "2018-11-01 00:00:00",
- end_date: "2018-11-05 00:00:00",
- car_brand: "BMW",
- car_model: "Z4",
- car_capacity: "5",
- addition_rule: "",
- driver_username: "Driver5"
- };
- it("add offer", function(done) {
- request(app)
- .post("/api/offers/addoffer")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });
- describe("Offers", function() {
- let data = {
- price: "50",
- starting_point: "Bangkok",
- destination: "London",
- start_date: "2018-11-01 00:00:00",
- end_date: "2018-11-05 00:00:00",
- car_brand: "BMW",
- car_model: "Z4",
- car_capacity: "5",
- addition_rule: "",
- driver_username: "Driver5"
- };
- it("add offer", function(done) {
- request(app)
- .post("/api/offers/addoffer")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });
- describe("Offers", function() {
- let data = {
- price: "50",
- starting_point: "Bangkok",
- destination: "London",
- start_date: "2018-11-01 00:00:00",
- end_date: "2018-11-05 00:00:00",
- car_brand: "BMW",
- car_model: "Z4",
- car_capacity: "5",
- addition_rule: "",
- driver_username: "Driver5"
- };
- it("add offer", function(done) {
- request(app)
- .post("/api/offers/addoffer")
- .send(data)
- .set("Accept", "application/json")
- .expect(200, done);
- });
- });*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement