2018-07-21 18:03:39 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
2018-04-25 16:28:41 +08:00
|
|
|
|
2018-07-21 18:03:39 +08:00
|
|
|
acceptance("Dashboard Next", {
|
2018-04-25 16:28:41 +08:00
|
|
|
loggedIn: true
|
|
|
|
});
|
|
|
|
|
2018-07-21 22:29:58 +08:00
|
|
|
QUnit.test("Visit dashboard next page", async assert => {
|
|
|
|
await visit("/admin");
|
|
|
|
|
|
|
|
assert.ok(exists(".dashboard-next"), "has dashboard-next class");
|
|
|
|
|
|
|
|
assert.ok(exists(".admin-report.signups"), "signups report");
|
|
|
|
assert.ok(exists(".admin-report.posts"), "posts report");
|
|
|
|
assert.ok(exists(".admin-report.dau-by-mau"), "dau-by-mau report");
|
|
|
|
assert.ok(
|
|
|
|
exists(".admin-report.daily-engaged-users"),
|
|
|
|
"daily-engaged-users report"
|
|
|
|
);
|
|
|
|
assert.ok(
|
|
|
|
exists(".admin-report.new-contributors"),
|
|
|
|
"new-contributors report"
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
$(".section.dashboard-problems .problem-messages ul li:first-child")
|
|
|
|
.html()
|
|
|
|
.trim(),
|
|
|
|
"Houston...",
|
|
|
|
"displays problems"
|
|
|
|
);
|
|
|
|
});
|
2018-08-22 18:37:05 +08:00
|
|
|
|
|
|
|
QUnit.test("it has counters", async assert => {
|
|
|
|
await visit("/admin");
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
$(".admin-report.page-view-total-reqs .today-count")
|
|
|
|
.text()
|
|
|
|
.trim(),
|
|
|
|
"1.1k"
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
$(".admin-report.page-view-total-reqs .yesterday-count")
|
|
|
|
.text()
|
|
|
|
.trim(),
|
|
|
|
"2.5k"
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
$(".admin-report.page-view-total-reqs .sevendays-count")
|
|
|
|
.text()
|
|
|
|
.trim(),
|
|
|
|
"18.6k"
|
|
|
|
);
|
|
|
|
assert.equal(
|
|
|
|
$(".admin-report.page-view-total-reqs .thirty-days-count")
|
|
|
|
.text()
|
|
|
|
.trim(),
|
|
|
|
"80.8k"
|
|
|
|
);
|
|
|
|
});
|