Consistent timeouts for the Space onPostAuth interceptor tests (#56158)

* Consistent timeouts for the Space onPostAuth interceptor tests

* Run 100 times

* Revert "Run 100 times"

This reverts commit 6054ac462e.
This commit is contained in:
Brandon Kobel 2020-01-28 12:59:13 -08:00 committed by GitHub
parent b8c81019a1
commit 597e7ea64b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(
@ -41,7 +42,7 @@ describe('onPostAuthInterceptor', () => {
beforeEach(async () => {
root = kbnTestServer.createRoot();
}, 30000);
});
afterEach(async () => await root.shutdown());
@ -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 = [
@ -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 = [
@ -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', () => {
@ -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 = [
@ -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 () => {
@ -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 = [
@ -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 () => {