Skip to content

Commit

Permalink
Force logout before starting couple of ITs
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Apr 18, 2022
1 parent c0196c8 commit 5d0afb9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/jest_integration/basic_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 5d0afb9

Please sign in to comment.