diff --git a/server/tests/connection.test.ts b/server/tests/connection.test.ts deleted file mode 100644 index 7abbb3aaadf62bb151d11be6430dc152af8ee755..0000000000000000000000000000000000000000 --- a/server/tests/connection.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -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); - }); -}); diff --git a/server/tests/database.test.ts b/server/tests/database.test.ts index 8b1ba47820896d6fe6ae326bd29ba62f880fa124..c2c3899e2fea5296e03024b69088cf4171cbca79 100644 --- a/server/tests/database.test.ts +++ b/server/tests/database.test.ts @@ -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({