kibana/x-pack/test/api_integration/services/usage_api.js
Stacey Gammon c14f7a72c4
Reporting API test expansion and clean up (#18986)
* Update & expand reporting API tests

* remove xpack stuff from oss archive

* wrap "it"s so they are in expected order.

* Update expected recent stats

* url was pointing to a visualization not a csv

* Move comment around

* Merging with changes on master renaming stats to usage

* fix reference to old stats file.

* bad merge
2018-05-22 12:48:20 -04:00

28 lines
753 B
JavaScript

/*
* 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.
*/
export function UsageAPIProvider({ getService }) {
const supertest = getService('supertest');
return {
async getUsageStats() {
const { body } = await supertest
.get('/api/_xpack/usage')
.set('kbn-xsrf', 'xxx')
.expect(200);
return body;
},
async getUsageStatsFromDeprecatedPre64Endpoint() {
const { body } = await supertest
.get('/api/_kibana/v1/stats')
.set('kbn-xsrf', 'xxx')
.expect(200);
return body;
},
};
}