FEATURE: allows to limit visible reports and tabs in dashboard (#9598)
This commit is contained in:
@@ -4,6 +4,7 @@ import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("Dashboard", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
dashboard_visible_tabs: "moderation|security|reports",
|
||||
dashboard_general_tab_activity_metrics: "page_view_total_reqs"
|
||||
},
|
||||
site: {
|
||||
@@ -20,8 +21,9 @@ acceptance("Dashboard", {
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("Dashboard", async assert => {
|
||||
QUnit.test("default", async assert => {
|
||||
await visit("/admin");
|
||||
|
||||
assert.ok(exists(".dashboard"), "has dashboard-next class");
|
||||
});
|
||||
|
||||
@@ -57,7 +59,7 @@ QUnit.test("general tab", async assert => {
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("general tab - activity metrics", async assert => {
|
||||
QUnit.test("activity metrics", async assert => {
|
||||
await visit("/admin");
|
||||
|
||||
assert.ok(exists(".admin-report.page-view-total-reqs .today-count"));
|
||||
@@ -100,7 +102,7 @@ QUnit.test("reports tab", async assert => {
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("report filters", async assert => {
|
||||
QUnit.test("reports filters", async assert => {
|
||||
await visit(
|
||||
'/admin/reports/signups_with_groups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'
|
||||
);
|
||||
@@ -113,3 +115,41 @@ QUnit.test("report filters", async assert => {
|
||||
"its set the value of the filter from the query params"
|
||||
);
|
||||
});
|
||||
|
||||
acceptance("Dashboard: dashboard_visible_tabs", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
dashboard_visible_tabs: "general|security|reports"
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("visible tabs", async assert => {
|
||||
await visit("/admin");
|
||||
|
||||
assert.ok(exists(".dashboard .navigation-item.general"), "general tab");
|
||||
assert.notOk(
|
||||
exists(".dashboard .navigation-item.moderation"),
|
||||
"moderation tab"
|
||||
);
|
||||
assert.ok(exists(".dashboard .navigation-item.security"), "security tab");
|
||||
assert.ok(exists(".dashboard .navigation-item.reports"), "reports tab");
|
||||
});
|
||||
|
||||
acceptance("Dashboard: dashboard_hidden_reports", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
dashboard_visible_tabs: "reports",
|
||||
dashboard_hidden_reports: "posts|dau_by_mau"
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("hidden reports", async assert => {
|
||||
await visit("/admin");
|
||||
|
||||
assert.ok(exists(".admin-report.signups.is-visible"), "signups report");
|
||||
assert.notOk(exists(".admin-report.is-visible.posts"), "posts report");
|
||||
assert.notOk(
|
||||
exists(".admin-report.is-visible.dau-by-mau"),
|
||||
"dau-by-mau report"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user