Skip to content

Commit

Permalink
Fix ES-Lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Klein <sebastian.klein93@gmx.de>
  • Loading branch information
KleinSebastian committed Nov 8, 2024
1 parent 9fcfd99 commit 1bc2661
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions server/auth/types/openid/openid_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ import { coreMock } from '../../../../../../src/core/public/mocks';

interface Logger {
debug(message: string): void;

info(message: string): void;

warn(message: string): void;

error(message: string): void;

fatal(message: string): void;
}

Expand Down Expand Up @@ -479,7 +483,7 @@ describe('Test OpenID Unauthorized Flows', () => {
});
});

test('Ensure nextUrl points to original request pathname',() =>{
test('Ensure nextUrl points to original request pathname', () => {
const mockCore = coreMock.createSetup();
const openIdAuthentication = new OpenIdAuthentication(
config,
Expand All @@ -501,17 +505,16 @@ describe('Test OpenID Unauthorized Flows', () => {

const authToolKitSpy = jest.spyOn(authToolkit, 'redirected');


openIdAuthentication.handleUnauthedRequest(osRequest, mockLifecycleFactory, authToolkit);

expect(authToolKitSpy).toHaveBeenCalledWith({
location: '/auth/openid/captureUrlFragment?nextUrl=/app/dashboards',
'set-cookie':
'security_authentication=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Path=/',
});
})
});

test('Ensure nextUrl points to original request pathname including security_tenant',() =>{
test('Ensure nextUrl points to original request pathname including security_tenant', () => {
const mockCore = coreMock.createSetup();
const openIdAuthentication = new OpenIdAuthentication(
config,
Expand All @@ -525,7 +528,7 @@ describe('Test OpenID Unauthorized Flows', () => {
const mockRequest = httpServerMock.createRawRequest({
url: {
pathname: '/app/dashboards',
search: 'security_tenant=testing'
search: 'security_tenant=testing',
},
});
const osRequest = OpenSearchDashboardsRequest.from(mockRequest);
Expand All @@ -534,14 +537,14 @@ describe('Test OpenID Unauthorized Flows', () => {

const authToolKitSpy = jest.spyOn(authToolkit, 'redirected');


openIdAuthentication.handleUnauthedRequest(osRequest, mockLifecycleFactory, authToolkit);

expect(authToolKitSpy).toHaveBeenCalledWith({
location: `/auth/openid/captureUrlFragment?nextUrl=${escape("/app/dashboards?security_tenant=testing")}`,
location: `/auth/openid/captureUrlFragment?nextUrl=${escape(
'/app/dashboards?security_tenant=testing'
)}`,
'set-cookie':
'security_authentication=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly; Path=/',
});
})

});
});

0 comments on commit 1bc2661

Please sign in to comment.