Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Sep 9, 2020
1 parent cffb373 commit c888364
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../../common/ftr_provider_context';
import { archives } from '../../config';
import archives from '../../archives_metadata';

export default function ApiTest({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');

// url parameters
const start = encodeURIComponent('2020-06-29T06:45:00.000Z');
const end = encodeURIComponent('2020-06-29T06:49:00.000Z');
const range = archives['apm_8.0.0'];
const start = encodeURIComponent(range.start);
const end = encodeURIComponent(range.end);

describe('Agent name', () => {
describe('when data is not loaded ', () => {
Expand All @@ -32,13 +32,9 @@ export default function ApiTest({ getService }: FtrProviderContext) {
before(() => esArchiver.load('apm_8.0.0'));
after(() => esArchiver.unload('apm_8.0.0'));

const { from, to } = archives['apm_8.0.0'];

it('returns the agent name', async () => {
const response = await supertest.get(
`/api/apm/services/opbeans-node/agent_name?start=${encodeURIComponent(
from
)}&end=${encodeURIComponent(to)}`
`/api/apm/services/opbeans-node/agent_name?start=${start}&end=${end}`
);

expect(response.status).to.be(200);
Expand Down

0 comments on commit c888364

Please sign in to comment.