2022-03-31 16:01:11 +02:00
|
|
|
const {agentProvider, fixtureManager, matchers} = require('../../utils/e2e-framework');
|
|
|
|
const {anyEtag, anyISODate} = matchers;
|
|
|
|
|
|
|
|
let agent;
|
|
|
|
|
|
|
|
describe('Stats API', function () {
|
|
|
|
before(async function () {
|
|
|
|
agent = await agentProvider.getAdminAPIAgent();
|
|
|
|
await fixtureManager.init('members');
|
|
|
|
await agent.loginAsOwner();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Can fetch member count history', async function () {
|
|
|
|
await agent
|
2022-03-31 17:09:28 +02:00
|
|
|
.get(`/stats/member_count`)
|
2022-03-31 16:01:11 +02:00
|
|
|
.expectStatus(200)
|
|
|
|
.matchBodySnapshot({
|
|
|
|
stats: [{
|
|
|
|
date: anyISODate
|
|
|
|
}]
|
|
|
|
})
|
|
|
|
.matchHeaderSnapshot({
|
|
|
|
etag: anyEtag
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|