DEV: simpler report page test (#7851)

This commit is contained in:
Joffrey JAFFEUX 2019-07-03 16:08:48 +02:00 committed by GitHub
parent 9ca1bbe900
commit d521959768
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 59 deletions

View File

@ -29,63 +29,7 @@ QUnit.test("Visit reports page", async assert => {
});
QUnit.test("Visit report page", async assert => {
// eslint-disable-next-line
server.get("/admin/reports/bulk", () => [
200,
{ "Content-Type": "application/json" },
{
reports: [
{
type: "staff_logins",
title: "Admin Logins",
xaxis: null,
yaxis: null,
description: "List of admin login times with locations.",
data: [
{
avatar_template:
"/user_avatar/dev.discourse.org/jo/{size}/17583_2.png",
user_id: 5656,
username: "Jo",
location: "Paris, France",
created_at: "2019-06-29T23:43:38.884Z"
}
],
start_date: "2019-06-29T00:00:00Z",
end_date: "2019-06-29T23:59:59Z",
prev_data: null,
prev_start_date: "2019-06-28T00:00:00Z",
prev_end_date: "2019-06-29T00:00:00Z",
prev30Days: null,
dates_filtering: true,
report_key: "reports:staff_logins:start:end:[:prev_period]:50:4",
primary_color: "rgba(0,136,204,1)",
secondary_color: "rgba(0,136,204,0.1)",
available_filters: [],
labels: [
{
type: "user",
properties: {
username: "username",
id: "user_id",
avatar: "avatar_template"
},
title: "User"
},
{ property: "location", title: "Location" },
{ property: "created_at", type: "precise_date", title: "Login at" }
],
average: false,
percent: false,
higher_is_better: true,
modes: ["table"],
limit: 50
}
]
}
]);
await visit("/admin/reports/staff_logins");
await visit("/admin/reports/page_view_total_reqs");
assert.ok(exists(".export-csv-btn"));
});

View File

@ -59,7 +59,8 @@ let signups = {
prev_end_date: "2018-06-17T00:00:00Z",
prev30Days: null,
dates_filtering: true,
report_key: 'reports:signups:start:end:[:prev_period]:50:{"group":"88"}:4',
report_key:
'reports:signups:20180616:20180716:[:prev_period]:50:{"group":"88"}:4',
available_filters: [
{ id: "group", allow_any: false, choices: [], default: "88" }
],
@ -158,7 +159,7 @@ const page_view_total_reqs = {
prev_end_date: "2018-07-23T00:00:00Z",
prev30Days: 58110,
dates_filtering: true,
report_key: `reports:page_view_total_reqs:start:end:[:prev_period]:${SCHEMA_VERSION}`,
report_key: `reports:page_view_total_reqs:start:end:[:prev_period]:50:${SCHEMA_VERSION}`,
labels: [
{ type: "date", property: "x", title: "Day" },
{ type: "number", property: "y", title: "Count" }