Skip to content

Commit

Permalink
fixing api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Sep 15, 2021
1 parent 0022c4a commit 401f1f3
Show file tree
Hide file tree
Showing 15 changed files with 2,424 additions and 833 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import expect from '@kbn/expect';
import archives_metadata from '../../common/fixtures/es_archiver/archives_metadata';
import { FtrProviderContext } from '../../common/ftr_provider_context';
import { registry } from '../../common/registry';
import { roundNumber } from '../../utils';

export default function ApiTest({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
Expand Down Expand Up @@ -54,8 +55,10 @@ export default function ApiTest({ getService }: FtrProviderContext) {

expectSnapshot(response.body.serviceCount).toMatchInline(`8`);

expectSnapshot(response.body.transactionPerMinute.value).toMatchInline(`58.9`);
expectSnapshot(response.body.transactionPerMinute.timeseries.length).toMatchInline(`30`);
expectSnapshot(roundNumber(response.body.transactionPerMinute.value)).toMatchInline(
`"59.17"`
);
expectSnapshot(response.body.transactionPerMinute.timeseries.length).toMatchInline(`31`);

expectSnapshot(
response.body.transactionPerMinute.timeseries
Expand All @@ -68,23 +71,23 @@ export default function ApiTest({ getService }: FtrProviderContext) {
Array [
Object {
"x": "2021-08-03T06:50:00.000Z",
"y": 36,
"y": 51,
},
Object {
"x": "2021-08-03T06:51:00.000Z",
"y": 55,
"y": 62,
},
Object {
"x": "2021-08-03T06:52:00.000Z",
"y": 40,
"y": 56,
},
Object {
"x": "2021-08-03T06:53:00.000Z",
"y": 53,
"y": 50,
},
Object {
"x": "2021-08-03T06:54:00.000Z",
"y": 39,
"y": 77,
},
]
`);
Expand Down
Loading

0 comments on commit 401f1f3

Please sign in to comment.