Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent timeouts for the Space onPostAuth interceptor tests #56158

Merged
merged 3 commits into from
Jan 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { securityMock } from '../../../../security/server/mocks';

describe('onPostAuthInterceptor', () => {
let root: ReturnType<typeof kbnTestServer.createRoot>;
jest.setTimeout(30000);

const headers = {
authorization: `Basic ${Buffer.from(
Expand All @@ -41,7 +42,7 @@ describe('onPostAuthInterceptor', () => {

beforeEach(async () => {
root = kbnTestServer.createRoot();
}, 30000);
});

afterEach(async () => await root.shutdown());

Expand Down Expand Up @@ -241,7 +242,7 @@ describe('onPostAuthInterceptor', () => {

expect(response.status).toEqual(302);
expect(response.header.location).toEqual(`/spaces/space_selector`);
}, 30000);
});

it('when accessing the kibana app it always allows the request to continue', async () => {
const spaces = [
Expand All @@ -258,7 +259,7 @@ describe('onPostAuthInterceptor', () => {
const { response } = await request('/s/a-space/app/kibana', spaces);

expect(response.status).toEqual(200);
}, 30000);
});

it('allows the request to continue when accessing an API endpoint within a non-existent space', async () => {
const spaces = [
Expand All @@ -274,7 +275,7 @@ describe('onPostAuthInterceptor', () => {
const { response } = await request('/s/not-found/api/test/foo', spaces);

expect(response.status).toEqual(200);
}, 30000);
});
});

describe('requests handled completely in the new platform', () => {
Expand All @@ -293,7 +294,7 @@ describe('onPostAuthInterceptor', () => {

expect(response.status).toEqual(302);
expect(response.header.location).toEqual(`/spaces/space_selector`);
}, 30000);
});

it('allows the request to continue when accessing an API endpoint within a non-existent space', async () => {
const spaces = [
Expand All @@ -309,7 +310,7 @@ describe('onPostAuthInterceptor', () => {
const { response } = await request('/s/not-found/api/np_test/foo', spaces);

expect(response.status).toEqual(200);
}, 30000);
});
});

it('handles space retrieval errors gracefully when requesting the root, responding with headers returned from ES', async () => {
Expand Down Expand Up @@ -421,7 +422,7 @@ describe('onPostAuthInterceptor', () => {
}),
})
);
}, 30000);
});

it('redirects to the "enter space" endpoint when accessing the root of a non-default space', async () => {
const spaces = [
Expand Down Expand Up @@ -454,7 +455,7 @@ describe('onPostAuthInterceptor', () => {
}),
})
);
}, 30000);
});

describe('with a single available space', () => {
it('it redirects to the "enter space" endpoint within the context of the single Space when navigating to Kibana root', async () => {
Expand Down