Skip to content
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
21 changes: 4 additions & 17 deletions x-pack/legacy/plugins/apm/public/utils/testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,10 @@ export async function inspectSearchParams(
const mockSetup = {
start: 1528113600000,
end: 1528977600000,
client: {
search: spy
} as any,
internalClient: {
search: spy
} as any,
config: new Proxy(
{},
{
get: () => 'myIndex'
}
) as APMConfig,
uiFiltersES: [
{
term: { 'service.environment': 'prod' }
}
],
client: { search: spy } as any,
internalClient: { search: spy } as any,
config: new Proxy({}, { get: () => 'myIndex' }) as APMConfig,
uiFiltersES: [{ term: { 'my.custom.ui.filter': 'foo-bar' } }],
indices: {
'apm_oss.sourcemapIndices': 'myIndex',
'apm_oss.errorIndices': 'myIndex',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function getErrorGroup({

let transaction;
if (transactionId && traceId) {
transaction = await getTransaction(transactionId, traceId, setup);
transaction = await getTransaction({ transactionId, traceId, setup });
}

return {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ import {
} from '../../helpers/setup_request';
import { ProcessorEvent } from '../../../../common/processor_event';

export async function getTransaction(
transactionId: string,
traceId: string,
setup: Setup & SetupTimeRange & SetupUIFilters
) {
const { start, end, uiFiltersES, client, indices } = setup;
export async function getTransaction({
transactionId,
traceId,
setup
}: {
transactionId: string;
traceId: string;
setup: Setup & SetupTimeRange & SetupUIFilters;
}) {
const { start, end, client, indices } = setup;

const params = {
index: indices['apm_oss.transactionIndices'],
Expand All @@ -35,8 +39,7 @@ export async function getTransaction(
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
{ term: { [TRANSACTION_ID]: transactionId } },
{ term: { [TRACE_ID]: traceId } },
{ range: rangeFilter(start, end) },
...uiFiltersES
{ range: rangeFilter(start, end) }
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('transaction queries', () => {

it('fetches a transaction', async () => {
mock = await inspectSearchParams(setup =>
getTransaction('foo', 'bar', setup)
getTransaction({ transactionId: 'foo', traceId: 'bar', setup })
);

expect(mock.params).toMatchSnapshot();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.