-
Notifications
You must be signed in to change notification settings - Fork 8.3k
/
instance.js
39 lines (32 loc) · 1.14 KB
/
instance.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import expect from '@kbn/expect';
import apmInstanceFixture from './fixtures/instance';
export default function ({ getService }) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('instance detail', () => {
const archive = 'monitoring/apm';
const timeRange = {
min: '2018-08-31T12:59:49.104Z',
max: '2018-08-31T13:59:49.104Z'
};
before('load archive', () => {
return esArchiver.load(archive);
});
after('unload archive', () => {
return esArchiver.unload(archive);
});
it('should get apm instance data', async () => {
const { body } = await supertest
.post('/api/monitoring/v1/clusters/GUtE4UwgSR-XUICRDEFKkA/apm/9b16f434-2092-4983-a401-80a2b61c79d6')
.set('kbn-xsrf', 'xxx')
.send({ timeRange })
.expect(200);
expect(body).to.eql(apmInstanceFixture);
});
});
}