fix countcontributingusers

This commit is contained in:
Michael C
2023-02-20 22:56:38 -05:00
parent 1bda331b0c
commit 31a460e750
4 changed files with 35 additions and 28 deletions

View File

@@ -9,7 +9,7 @@ describe("getTotalStats", () => {
it("Can get total stats", async () => {
const result = await client({ url: endpoint });
const data = result.data;
assert.ok(data.userCount >= 0);
assert.strictEqual(data.userCount, 0, "User count should default false");
assert.ok(data.activeUsers >= 0);
assert.ok(data.apiUsers >= 0);
assert.ok(data.viewCount >= 0);
@@ -31,9 +31,9 @@ describe("getTotalStats", () => {
it("Can get total stats with old cws method", async () => {
const stub = sinon.stub(getCWSUsers, "getCWSUsers");
stub.resolves(undefined);
const result = await client({ url: `${endpoint}?countContributingUsers=false` });
const result = await client({ url: `${endpoint}?countContributingUsers=true` });
const data = result.data;
assert.strictEqual(data.userCount, 0);
assert.ok(data.userCount >= 0);
assert.ok(data.activeUsers >= 0);
assert.ok(data.apiUsers >= 0);
assert.ok(data.viewCount >= 0);