From f794e612eea42f24d4b9e18ffb517516b2d1ba0e Mon Sep 17 00:00:00 2001 From: Mandeep Singh Date: Tue, 12 Dec 2023 00:29:17 +0530 Subject: [PATCH] adds fallback url for backend --- __tests__/Home.test.tsx | 3 --- __tests__/Navbar.test.tsx | 1 - app/utils/config/backendUrl.ts | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/__tests__/Home.test.tsx b/__tests__/Home.test.tsx index 9d8efa1..ecb1006 100644 --- a/__tests__/Home.test.tsx +++ b/__tests__/Home.test.tsx @@ -165,8 +165,6 @@ describe("Home Component", () => { } as Response) ); - // screen.debug(undefined, Infinity); - // eslint-disable-next-line testing-library/no-unnecessary-act await act(async () => { render( @@ -180,7 +178,6 @@ describe("Home Component", () => { const trendingPostsElementsUndefined = screen.queryAllByTestId("trending-post"); expect(trendingPostsElementsUndefined.length).toBe(0); - // screen.debug(undefined, Infinity); // // reset the backend url // process.env.NEXT_PUBLIC_BACKEND_URL = "http://localhost:3000/api"; diff --git a/__tests__/Navbar.test.tsx b/__tests__/Navbar.test.tsx index 9b48553..c5eb0c0 100644 --- a/__tests__/Navbar.test.tsx +++ b/__tests__/Navbar.test.tsx @@ -177,6 +177,5 @@ describe("Navbar for authenticated user", () => { window.innerWidth = 1024; fireEvent(window, new Event("resize")); - screen.debug(undefined, Infinity); }); }); diff --git a/app/utils/config/backendUrl.ts b/app/utils/config/backendUrl.ts index 5fc7796..c61ce97 100644 --- a/app/utils/config/backendUrl.ts +++ b/app/utils/config/backendUrl.ts @@ -1 +1 @@ -export const backendUrl = `${process.env.NEXT_PUBLIC_BACKEND_URL}`; \ No newline at end of file +export const backendUrl =`${process.env.NEXT_PUBLIC_BACKEND_URL || "http://localhost:3000/api"}`; \ No newline at end of file