From c227eda7c96df064e63310ce3bc897d0e7bef8e7 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Sat, 4 Nov 2023 22:18:15 -0300 Subject: [PATCH] Fix more bugs --- auth-domain/.env.dev.example | 1 + auth-domain/docker-compose.dev.yml | 1 + auth-domain/user-manager/src/config.py | 2 +- screen-domain/src/components/Home/Arrival.test.tsx | 9 --------- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/auth-domain/.env.dev.example b/auth-domain/.env.dev.example index abd888b..da8732b 100644 --- a/auth-domain/.env.dev.example +++ b/auth-domain/.env.dev.example @@ -1,4 +1,5 @@ POSTGRES_USER=user POSTGRES_PASS=password POSTGRES_DB=api_dev +POSTGRES_DB_TEST=api_prod APP_SETTINGS=src.config.DevelopmentConfig \ No newline at end of file diff --git a/auth-domain/docker-compose.dev.yml b/auth-domain/docker-compose.dev.yml index 8600468..e8c0563 100644 --- a/auth-domain/docker-compose.dev.yml +++ b/auth-domain/docker-compose.dev.yml @@ -8,6 +8,7 @@ services: container_name: fids_usermanager_api_dev environment: - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db-dev/${POSTGRES_DB} + - DATABASE_TEST_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@usermanager-db-dev/${POSTGRES_DB_TEST} depends_on: usermanager-db-dev: condition: service_healthy diff --git a/auth-domain/user-manager/src/config.py b/auth-domain/user-manager/src/config.py index a7ba373..7387ace 100644 --- a/auth-domain/user-manager/src/config.py +++ b/auth-domain/user-manager/src/config.py @@ -16,7 +16,7 @@ class DevelopmentConfig(BaseConfig): class TestingConfig(BaseConfig): TESTING = True - SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") + SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_TEST_URL") BCRYPT_LOG_ROUNDS = 4 ACCESS_TOKEN_EXPIRATION = 5 REFRESH_TOKEN_EXPIRATION = 5 diff --git a/screen-domain/src/components/Home/Arrival.test.tsx b/screen-domain/src/components/Home/Arrival.test.tsx index 4dbe4d5..67b3dae 100644 --- a/screen-domain/src/components/Home/Arrival.test.tsx +++ b/screen-domain/src/components/Home/Arrival.test.tsx @@ -22,7 +22,6 @@ describe("Arrival Component Tests", () => { expect(screen.getByText("Code")).toBeInTheDocument(); expect(screen.getByText("Origin")).toBeInTheDocument(); expect(screen.getByText("Time")).toBeInTheDocument(); - expect(screen.getByText("Gate")).toBeInTheDocument(); expect(screen.getByText("Status")).toBeInTheDocument(); }); @@ -53,7 +52,6 @@ describe("Arrival Component Tests", () => { expect(screen.queryByText("ABC123")).not.toBeInTheDocument(); expect(screen.queryByText("City A")).not.toBeInTheDocument(); expect(screen.queryByText("2023-10-30 12:00 PM")).not.toBeInTheDocument(); - expect(screen.queryByText("A1")).not.toBeInTheDocument(); expect(screen.queryByText("On Time")).not.toBeInTheDocument(); }) @@ -95,13 +93,11 @@ describe("Arrival Component Tests", () => { expect(screen.getByText("ABC123")).toBeInTheDocument(); expect(screen.getByText("City A")).toBeInTheDocument(); expect(screen.getByText("2023-10-30 12:00 PM")).toBeInTheDocument(); - expect(screen.getByText("A1")).toBeInTheDocument(); expect(screen.getByText("On Time")).toBeInTheDocument(); expect(screen.getByText("XYZ789")).toBeInTheDocument(); expect(screen.getByText("City B")).toBeInTheDocument(); expect(screen.getByText("2023-10-31 02:30 PM")).toBeInTheDocument(); - expect(screen.getByText("B2")).toBeInTheDocument(); expect(screen.getByText("Delayed")).toBeInTheDocument(); }); }); @@ -235,13 +231,11 @@ describe("Arrival Component Tests", () => { expect(screen.getByText("ABC123")).toBeInTheDocument(); expect(screen.getByText("City A")).toBeInTheDocument(); expect(screen.getByText("2023-10-30 12:00 PM")).toBeInTheDocument(); - expect(screen.getByText("A1")).toBeInTheDocument(); expect(screen.getByText("On Time")).toBeInTheDocument(); expect(screen.queryByText("XYZ788")).toBeInTheDocument(); expect(screen.queryByText("City C")).toBeInTheDocument(); expect(screen.queryByText("2023-10-31 02:31 PM")).toBeInTheDocument(); - expect(screen.queryByText("B3")).toBeInTheDocument(); expect(screen.queryByText("Scheduled")).toBeInTheDocument(); }); @@ -254,19 +248,16 @@ describe("Arrival Component Tests", () => { expect(screen.queryByText("ABC123")).not.toBeInTheDocument(); expect(screen.queryByText("City A")).not.toBeInTheDocument(); expect(screen.queryByText("2023-10-30 12:00 PM")).not.toBeInTheDocument(); - expect(screen.queryByText("A1")).not.toBeInTheDocument(); expect(screen.queryByText("On Time")).not.toBeInTheDocument(); expect(screen.queryByText("XYZ788")).not.toBeInTheDocument(); expect(screen.queryByText("City C")).not.toBeInTheDocument(); expect(screen.queryByText("2023-10-31 02:31 PM")).not.toBeInTheDocument(); - expect(screen.queryByText("B3")).not.toBeInTheDocument(); expect(screen.queryByText("Scheduled")).not.toBeInTheDocument(); expect(screen.getByText("XYZ789")).toBeInTheDocument(); expect(screen.getByText("City B")).toBeInTheDocument(); expect(screen.getByText("2023-10-31 02:30 PM")).toBeInTheDocument(); - expect(screen.getByText("B2")).toBeInTheDocument(); expect(screen.getByText("Delayed")).toBeInTheDocument(); }); });