mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[APM] remove redundant unit tests for getEnvironment (#152577)
## Summary Removes redundant Unit Tests and Snapshots. As part of the list mentioned here https://github.com/elastic/kibana/issues/152557#issuecomment-1451790793, the getEnvironment logic now has its own API tests and hence we can remove these unit tests. API tests were added as part of this [PR](https://github.com/elastic/kibana/pull/150175/files#diff-00aefdb700a89f09360583a1a951083746eb2243e0607de9ab6bc81826a7adaf) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
883b45fa55
commit
bc64e05281
2 changed files with 0 additions and 135 deletions
|
@ -1,86 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`getEnvironments fetches environments 1`] = `
|
||||
Object {
|
||||
"apm": Object {
|
||||
"events": Array [
|
||||
"transaction",
|
||||
"metric",
|
||||
"error",
|
||||
],
|
||||
},
|
||||
"body": Object {
|
||||
"aggs": Object {
|
||||
"environments": Object {
|
||||
"terms": Object {
|
||||
"field": "service.environment",
|
||||
"missing": "ENVIRONMENT_NOT_DEFINED",
|
||||
"size": 50,
|
||||
},
|
||||
},
|
||||
},
|
||||
"query": Object {
|
||||
"bool": Object {
|
||||
"filter": Array [
|
||||
Object {
|
||||
"range": Object {
|
||||
"@timestamp": Object {
|
||||
"format": "epoch_millis",
|
||||
"gte": 0,
|
||||
"lte": 50000,
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.name": "foo",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
"size": 0,
|
||||
"track_total_hits": false,
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`getEnvironments fetches environments without a service name 1`] = `
|
||||
Object {
|
||||
"apm": Object {
|
||||
"events": Array [
|
||||
"transaction",
|
||||
"metric",
|
||||
"error",
|
||||
],
|
||||
},
|
||||
"body": Object {
|
||||
"aggs": Object {
|
||||
"environments": Object {
|
||||
"terms": Object {
|
||||
"field": "service.environment",
|
||||
"missing": "ENVIRONMENT_NOT_DEFINED",
|
||||
"size": 50,
|
||||
},
|
||||
},
|
||||
},
|
||||
"query": Object {
|
||||
"bool": Object {
|
||||
"filter": Array [
|
||||
Object {
|
||||
"range": Object {
|
||||
"@timestamp": Object {
|
||||
"format": "epoch_millis",
|
||||
"gte": 0,
|
||||
"lte": 50000,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
"size": 0,
|
||||
"track_total_hits": false,
|
||||
},
|
||||
}
|
||||
`;
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import { getEnvironments } from './get_environments';
|
||||
import {
|
||||
SearchParamsMock,
|
||||
inspectSearchParams,
|
||||
} from '../../utils/test_helpers';
|
||||
|
||||
describe('getEnvironments', () => {
|
||||
let mock: SearchParamsMock;
|
||||
|
||||
afterEach(() => {
|
||||
mock.teardown();
|
||||
});
|
||||
|
||||
it('fetches environments', async () => {
|
||||
mock = await inspectSearchParams(({ mockApmEventClient }) =>
|
||||
getEnvironments({
|
||||
apmEventClient: mockApmEventClient,
|
||||
serviceName: 'foo',
|
||||
searchAggregatedTransactions: false,
|
||||
size: 50,
|
||||
start: 0,
|
||||
end: 50000,
|
||||
})
|
||||
);
|
||||
|
||||
expect(mock.params).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('fetches environments without a service name', async () => {
|
||||
mock = await inspectSearchParams(({ mockApmEventClient }) =>
|
||||
getEnvironments({
|
||||
apmEventClient: mockApmEventClient,
|
||||
searchAggregatedTransactions: false,
|
||||
size: 50,
|
||||
start: 0,
|
||||
end: 50000,
|
||||
})
|
||||
);
|
||||
|
||||
expect(mock.params).toMatchSnapshot();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue