From 39aa300c05a646b4a0448c6b0bb0dc10f13cc912 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Wed, 18 Oct 2023 13:17:56 +0200 Subject: [PATCH] fix(tests): correctly set baseUriPath in setupAppWithBaseUrl (#5068) This appears to be a bug. I can confirm that the base path did not take effect with the previous incarnation, but this should fix that. --- src/test/e2e/helpers/test-helper.ts | 2 +- src/test/e2e/routes/routes.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/e2e/helpers/test-helper.ts b/src/test/e2e/helpers/test-helper.ts index 038ab0ff23..8295a121e8 100644 --- a/src/test/e2e/helpers/test-helper.ts +++ b/src/test/e2e/helpers/test-helper.ts @@ -296,7 +296,7 @@ export async function setupAppWithBaseUrl( return createApp(stores, undefined, undefined, { server: { unleashUrl: 'http://localhost:4242', - basePathUri: '/hosted', + baseUriPath: '/hosted', }, }); } diff --git a/src/test/e2e/routes/routes.test.ts b/src/test/e2e/routes/routes.test.ts index 75bc95ad6a..e8a5cbf140 100644 --- a/src/test/e2e/routes/routes.test.ts +++ b/src/test/e2e/routes/routes.test.ts @@ -20,7 +20,7 @@ afterAll(async () => { test('hitting a baseUri path returns HTML document', async () => { expect.assertions(0); await app.request - .get('/hosted') + .get('/hosted/projects') .expect(200) .expect('Content-Type', 'text/html; charset=utf-8'); }); @@ -33,7 +33,7 @@ test('hitting an api path that does not exist returns 404', async () => { test('hitting an /admin/api returns HTML document', async () => { expect.assertions(0); await app.request - .get('/admin/api') + .get('/hosted/admin/api') .expect(200) .expect('Content-Type', 'text/html; charset=utf-8'); });