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

[7.x] [Reporting] Rewrite addForceNowQuerystring to getFullUrls (#44851) #45205

Merged
merged 3 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ describe('headers', () => {
isImmediate: false,
savedObjectType: 'search',
},
relativeUrl: '/app/kibana#/something',
timeRange: {},
},
server: mockServer,
})
Expand All @@ -55,7 +53,6 @@ describe('headers', () => {
isImmediate: false,
savedObjectType: 'search',
},
relativeUrl: '/app/kibana#/something',
headers: encryptedHeaders,
},
server: mockServer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import { createMockServer } from '../../../test_helpers/create_mock_server';
import { getConditionalHeaders, getCustomLogo } from './index';
import { JobDocPayload } from '../../../types';
import { JobDocPayloadPDF } from '../../printable_pdf/types';

let mockServer: any;
beforeEach(() => {
Expand All @@ -26,15 +28,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -51,15 +45,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -80,15 +66,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -105,15 +83,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -128,15 +98,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -159,15 +121,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -184,15 +138,7 @@ describe('conditions', () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -208,15 +154,7 @@ test('uses basePath from job when creating saved object service', async () => {
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -226,16 +164,7 @@ test('uses basePath from job when creating saved object service', async () => {

const jobBasePath = '/sbp/s/marketing';
await getCustomLogo({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
basePath: jobBasePath,
},
job: { basePath: jobBasePath } as JobDocPayloadPDF,
conditionalHeaders,
server: mockServer,
});
Expand All @@ -252,15 +181,7 @@ test(`uses basePath from server if job doesn't have a basePath when creating sav
};

const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: permittedHeaders,
server: mockServer,
});
Expand All @@ -269,15 +190,7 @@ test(`uses basePath from server if job doesn't have a basePath when creating sav
mockServer.uiSettingsServiceFactory().get.mockReturnValue(logo);

await getCustomLogo({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayloadPDF,
conditionalHeaders,
server: mockServer,
});
Expand All @@ -291,15 +204,7 @@ describe('config formatting', () => {
test(`lowercases server.host`, async () => {
mockServer = createMockServer({ settings: { 'server.host': 'COOL-HOSTNAME' } });
const { conditionalHeaders } = await getConditionalHeaders({
job: {
title: 'cool-job-bro',
type: 'csv',
jobParams: {
savedObjectId: 'abc-123',
isImmediate: false,
savedObjectType: 'search',
},
},
job: {} as JobDocPayload,
filteredHeaders: {},
server: mockServer,
});
Expand Down
Loading