From 3e7ed982d41eac458545af13d4f8087e4b553668 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Fri, 20 May 2022 09:27:21 -0500 Subject: [PATCH] fix tests --- web/config/handlers.js | 6 +++--- web/src/__mocks__/env.js | 2 +- web/src/api/__tests__/index.test.jsx | 2 +- web/src/env.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/config/handlers.js b/web/config/handlers.js index 7afd23109..706545165 100644 --- a/web/config/handlers.js +++ b/web/config/handlers.js @@ -2,7 +2,7 @@ import { rest } from 'msw'; import { API_HOST } from '../src/env'; export const handlers = [ - rest.get(`${API_HOST}/api/config`, (req, res, ctx) => { + rest.get(`${API_HOST}api/config`, (req, res, ctx) => { return res( ctx.status(200), ctx.json({ @@ -35,7 +35,7 @@ export const handlers = [ }) ); }), - rest.get(`${API_HOST}/api/stats`, (req, res, ctx) => { + rest.get(`${API_HOST}api/stats`, (req, res, ctx) => { return res( ctx.status(200), ctx.json({ @@ -54,7 +54,7 @@ export const handlers = [ }) ); }), - rest.get(`${API_HOST}/api/events`, (req, res, ctx) => { + rest.get(`${API_HOST}api/events`, (req, res, ctx) => { return res( ctx.status(200), ctx.json( diff --git a/web/src/__mocks__/env.js b/web/src/__mocks__/env.js index 5d7b8a452..7ff1a2ac7 100644 --- a/web/src/__mocks__/env.js +++ b/web/src/__mocks__/env.js @@ -1,2 +1,2 @@ export const ENV = 'test'; -export const API_HOST = 'http://base-url.local:5000'; +export const API_HOST = 'http://base-url.local:5000/'; diff --git a/web/src/api/__tests__/index.test.jsx b/web/src/api/__tests__/index.test.jsx index 434a944a6..0c871766e 100644 --- a/web/src/api/__tests__/index.test.jsx +++ b/web/src/api/__tests__/index.test.jsx @@ -18,6 +18,6 @@ describe('useApiHost', () => { ); - expect(screen.queryByText('http://base-url.local:5000')).toBeInTheDocument(); + expect(screen.queryByText('http://base-url.local:5000/')).toBeInTheDocument(); }); }); diff --git a/web/src/env.js b/web/src/env.js index 5c830581e..99fd57635 100644 --- a/web/src/env.js +++ b/web/src/env.js @@ -1,2 +1,2 @@ export const ENV = import.meta.env.MODE; -export const API_HOST = ENV === "production" ? "" : "http://localhost:5000"; +export const API_HOST = ENV === 'production' ? '' : 'http://localhost:5000/';