2018-06-18 18:31:56 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
|
|
|
acceptance("Reports", {
|
|
|
|
loggedIn: true
|
|
|
|
});
|
|
|
|
|
2018-07-19 22:40:12 +08:00
|
|
|
QUnit.test("Visit reports page", async assert => {
|
|
|
|
await visit("/admin/reports");
|
2018-06-18 18:31:56 +08:00
|
|
|
|
2018-07-19 22:40:12 +08:00
|
|
|
assert.equal($(".reports-list .report").length, 1);
|
2018-06-18 18:31:56 +08:00
|
|
|
|
2018-07-19 22:40:12 +08:00
|
|
|
const $report = $(".reports-list .report:first-child");
|
2018-06-18 18:31:56 +08:00
|
|
|
|
2018-07-19 22:40:12 +08:00
|
|
|
assert.equal(
|
|
|
|
$report
|
|
|
|
.find(".report-title")
|
|
|
|
.html()
|
|
|
|
.trim(),
|
|
|
|
"My report"
|
|
|
|
);
|
2018-06-18 18:31:56 +08:00
|
|
|
|
2018-07-19 22:40:12 +08:00
|
|
|
assert.equal(
|
|
|
|
$report
|
|
|
|
.find(".report-description")
|
|
|
|
.html()
|
|
|
|
.trim(),
|
|
|
|
"List of my activities"
|
|
|
|
);
|
2018-06-18 18:31:56 +08:00
|
|
|
});
|
2019-07-03 20:47:36 +08:00
|
|
|
|
|
|
|
QUnit.test("Visit report page", async assert => {
|
2019-07-03 22:32:27 +08:00
|
|
|
await visit("/admin/reports/staff_logins");
|
2019-07-03 21:43:01 +08:00
|
|
|
|
2019-07-03 20:47:36 +08:00
|
|
|
assert.ok(exists(".export-csv-btn"));
|
|
|
|
});
|