From 5d0afb99bcaafd8fbe204e69e81ab2a2d839dd47 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Mon, 18 Apr 2022 18:05:33 -0400 Subject: [PATCH] Force logout before starting couple of ITs Signed-off-by: Darshit Chanpura --- test/jest_integration/basic_auth.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/jest_integration/basic_auth.test.ts b/test/jest_integration/basic_auth.test.ts index 0550a51c0..907113154 100644 --- a/test/jest_integration/basic_auth.test.ts +++ b/test/jest_integration/basic_auth.test.ts @@ -216,6 +216,10 @@ describe('start OpenSearch Dashboards server', () => { }); it('redirect for home follows login', async () => { + const logout = await osdTestServer.request + .post(root, '/auth/logout') + .unset(AUTHORIZATION_HEADER_NAME); + const response = await osdTestServer.request .get(root, '/app/home#/') .unset(AUTHORIZATION_HEADER_NAME); @@ -241,6 +245,10 @@ describe('start OpenSearch Dashboards server', () => { const startingPath = `/app/dashboards#/view/edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b`; const expectedPath = `/app/login?nextUrl=%2Fapp%2Fdashboards`; + const logout = await osdTestServer.request + .post(root, '/auth/logout') + .unset(AUTHORIZATION_HEADER_NAME); + const response = await osdTestServer.request .get(root, startingPath) .unset(AUTHORIZATION_HEADER_NAME);