Skip to content
Snippets Groups Projects
Commit 50e4c015 authored by Leander Tolksdorf's avatar Leander Tolksdorf
Browse files

Merge branch '31-connect-fronted-to-backend' of...

Merge branch '31-connect-fronted-to-backend' of git.imp.fu-berlin.de:swp-ws21-fahrtenbuch/team-einhorn/fahrtenbuch into 31-connect-fronted-to-backend
parents c2a9f891 5afe1cd8
No related branches found
No related tags found
No related merge requests found
require("dotenv").config();
import request from "supertest";
describe("GET Endpoints", () => {
/*
* NOTICE:
* Those are structural test examples.
* I've made it, that they all expect 404 errors,
* since the database models have changes while the API hasn't
*/
it("if response is 200, server is alive ", (done) => {
request("http://localhost:4000")
.get("/")
.set("Accept", "text/html")
.expect("Content-Type", /html/)
.expect(200, done);
});
it("Get Vehicle Type with ID (returns 404 since no data)", (done) => {
request("http://localhost:4000")
.get("/vehicleType/1")
.set("Accept", "text/html")
.expect("Content-Type", /html/)
.expect(404, done);
});
it("Get all Vehicle Types", (done) => {
request("http://localhost:4000")
.get("/vehicleType")
.set("Accept", "text/html")
.expect("Content-Type", /html/)
.expect(404, done);
});
});
......@@ -24,19 +24,22 @@ describe("Database Tests", () => {
columns: [
{ column_name: "id", data_type: "uuid" },
{ column_name: "startTime", data_type: "timestamp with time zone" },
{
column_name: "estimatedEndTime",
data_type: "timestamp with time zone",
},
{ column_name: "estimatedEndTime",data_type: "timestamp with time zone"},
{ column_name: "boatId", data_type: "uuid" },
{ column_name: "createdAt", data_type: "timestamp with time zone" },
{ column_name: "updatedAt", data_type: "timestamp with time zone" },
{ column_name: "email", data_type: "character varying" },
{
column_name: "fullNameOfResponsableClient",
column_name: "fullNameOfResponsibleClient",
data_type: "character varying",
},
{ column_name: "additionalClients", data_type: "ARRAY" },
{ column_name: "numP", data_type: "integer" },
{ column_name: "date", data_type: "timestamp with time zone" },
{ column_name: "returned", data_type: "boolean" },
{ column_name: "destination", data_type: "character varying" },
{ column_name: "note", data_type: "character varying" },
{ column_name: "bookingType", data_type: "character varying" },
],
},
{
......@@ -49,6 +52,8 @@ describe("Database Tests", () => {
{ column_name: "id", data_type: "uuid" },
{ column_name: "name", data_type: "character varying" },
{ column_name: "tags", data_type: "ARRAY" },
{ column_name: "minP", data_type: "integer" },
{ column_name: "maxP", data_type: "integer" },
],
},
{
......@@ -74,6 +79,25 @@ describe("Database Tests", () => {
{ column_name: "first_name", data_type: "character varying" },
],
},
{
table_name: "sport",
columns: [
{ column_name: "id", data_type: "uuid" },
{ column_name: "createdAt", data_type: "timestamp with time zone" },
{ column_name: "updatedAt", data_type: "timestamp with time zone" },
{ column_name: "name", data_type: "character varying" },
{ column_name: "color", data_type: "character varying" },
]
},
{
table_name: "boathassport",
columns: [
{ column_name: "boatid", data_type: "uuid" },
{ column_name: "sportid", data_type: "uuid" },
{ column_name: "createdAt", data_type: "timestamp with time zone" },
{ column_name: "updatedAt", data_type: "timestamp with time zone" },
]
}
];
beforeAll(async () => {
client = new Client({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment