[7.x] Exclude usage stats when exclude_usage flag is specified (#35691) (#35700)

* Exclude usage stats when `exclude_usage` flag is specified

* Entirely excluding the usage key altogether

* Adding API integration test

* Fixing param name in comment + adding more info to comment

* Fix API test copy-pasta

* Fixing test assertion syntax
This commit is contained in:
Shaunak Kashyap 2019-04-27 01:06:02 -07:00 committed by GitHub
parent f1e388ef2c
commit f81263da8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 7 deletions

View file

@ -118,6 +118,18 @@ export default function ({ getService }) {
});
});
});
describe('exclude usage', () => {
it('should exclude usage from the API response', () => {
return supertest
.get('/api/stats?extended&exclude_usage')
.expect('Content-Type', /json/)
.expect(200)
.then(({ body }) => {
expect(body).to.not.have.property('usage');
});
});
});
});
});
}