From ae71176dd78930841479257066304f22ef079b29 Mon Sep 17 00:00:00 2001
From: Alexander Rudolph <alexr30@web.de>
Date: Sun, 30 Jan 2022 19:09:46 +0100
Subject: [PATCH] fix database tests by adding new columns and tables

---
 server/tests/database.test.ts | 36 +++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/server/tests/database.test.ts b/server/tests/database.test.ts
index 8b1ba47..6e4d554 100644
--- a/server/tests/database.test.ts
+++ b/server/tests/database.test.ts
@@ -1,5 +1,5 @@
 import { Client } from "pg";
-
+require("dotenv").config();
 it("has the database", async () => {
   const client = new Client({
     user: process.env.POSTGRES_USER,
@@ -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({
-- 
GitLab