clean up getCWSUsers

This commit is contained in:
Michael C
2023-02-21 20:09:38 -05:00
parent f4537160de
commit 4b8bc418ba
2 changed files with 7 additions and 12 deletions

View File

@@ -1,7 +1,5 @@
import assert from "assert";
import { client } from "../utils/httpClient";
import sinon from "sinon";
import * as getCWSUsers from "../../src/utils/getCWSUsers";
const endpoint = "/api/getTotalStats";
@@ -28,9 +26,7 @@ describe("getTotalStats", () => {
assert.ok(data.minutesSaved >= 0);
});
it("Can get total stats with old cws method", async () => {
const stub = sinon.stub(getCWSUsers, "getCWSUsers");
stub.resolves(undefined);
it("Can get total stats with contributing users", async () => {
const result = await client({ url: `${endpoint}?countContributingUsers=true` });
const data = result.data;
assert.ok(data.userCount >= 0);
@@ -39,6 +35,5 @@ describe("getTotalStats", () => {
assert.ok(data.viewCount >= 0);
assert.ok(data.totalSubmissions >= 0);
assert.ok(data.minutesSaved >= 0);
stub.restore();
});
});