mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 09:03:44 +08:00
dashboard next: adds basic spec
This commit is contained in:
parent
ee82abba3c
commit
a9c3437d51
16
test/javascripts/acceptance/dashboard-next-test.js.es6
Normal file
16
test/javascripts/acceptance/dashboard-next-test.js.es6
Normal file
|
@ -0,0 +1,16 @@
|
|||
import {
|
||||
acceptance
|
||||
}
|
||||
from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Dashboard Next", {
|
||||
loggedIn: true
|
||||
});
|
||||
|
||||
QUnit.test("Vist dashboard next page", assert => {
|
||||
visit("/admin/dashboard-next");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok($('.dashboard-next').length, "has dashboard-next class");
|
||||
});
|
||||
});
|
146
test/javascripts/fixtures/dashboard-next.js.es6
Normal file
146
test/javascripts/fixtures/dashboard-next.js.es6
Normal file
|
@ -0,0 +1,146 @@
|
|||
export default {
|
||||
"/admin/dashboard-next.json": {
|
||||
"global_reports": [{
|
||||
"type": "signups",
|
||||
"title": "New Users",
|
||||
"xaxis": "Day",
|
||||
"yaxis": "Number of new users",
|
||||
"data": [{
|
||||
"x": "2018-04-11",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-12",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-13",
|
||||
"y": 58
|
||||
}, {
|
||||
"x": "2018-04-15",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-16",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-17",
|
||||
"y": 19
|
||||
}, {
|
||||
"x": "2018-04-19",
|
||||
"y": 19
|
||||
}],
|
||||
"total": 136,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": 0,
|
||||
"labels": null
|
||||
}, {
|
||||
"type": "topics",
|
||||
"title": "Topics",
|
||||
"xaxis": "Day",
|
||||
"yaxis": "Number of new topics",
|
||||
"data": [{
|
||||
"x": "2018-04-11",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-12",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-13",
|
||||
"y": 60
|
||||
}, {
|
||||
"x": "2018-04-15",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-16",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-17",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-19",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-20",
|
||||
"y": 1
|
||||
}],
|
||||
"total": 121,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": 0,
|
||||
"labels": null
|
||||
}, {
|
||||
"type": "trending_search",
|
||||
"title": "Trending search",
|
||||
"xaxis": "translation missing: en.reports.trending_search.xaxis",
|
||||
"yaxis": "translation missing: en.reports.trending_search.yaxis",
|
||||
"data": [
|
||||
["lon", 3, 1],
|
||||
["pub", 1, 1],
|
||||
["something", 1, 1]
|
||||
],
|
||||
"total": null,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": null,
|
||||
"labels": ["Term", "Searches", "Unique"]
|
||||
}],
|
||||
"user_reports": [{
|
||||
"type": "users_by_trust_level",
|
||||
"title": "Users per Trust Level",
|
||||
"xaxis": "Trust Level",
|
||||
"yaxis": "Number of Users",
|
||||
"data": [{
|
||||
"x": 0,
|
||||
"y": 132
|
||||
}, {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}, {
|
||||
"x": 3,
|
||||
"y": 1
|
||||
}, {
|
||||
"x": 2,
|
||||
"y": 1
|
||||
}, {
|
||||
"x": 4,
|
||||
"y": 1
|
||||
}],
|
||||
"total": null,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": null,
|
||||
"labels": null
|
||||
}, {
|
||||
"type": "users_by_type",
|
||||
"title": "Users per Type",
|
||||
"xaxis": "Type",
|
||||
"yaxis": "Number of Users",
|
||||
"data": [{
|
||||
"x": "Admin",
|
||||
"y": 1
|
||||
}],
|
||||
"total": null,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": null,
|
||||
"labels": null
|
||||
}],
|
||||
"last_backup_taken_at": "2018-04-13T12:51:19.926Z",
|
||||
"updated_at": "2018-04-25T08:06:11.292Z",
|
||||
"disk_space": {
|
||||
"uploads_used": "74.5 KB",
|
||||
"uploads_free": "117 GB",
|
||||
"backups_used": "4.24 GB",
|
||||
"backups_free": "117 GB"
|
||||
}
|
||||
}
|
||||
};
|
45
test/javascripts/fixtures/signups.js.es6
Normal file
45
test/javascripts/fixtures/signups.js.es6
Normal file
|
@ -0,0 +1,45 @@
|
|||
export default {
|
||||
"/admin/reports/signups": {
|
||||
"report": {
|
||||
"type": "signups",
|
||||
"title": "New Users",
|
||||
"xaxis": "Day",
|
||||
"yaxis": "Number of new users",
|
||||
"data": [{
|
||||
"x": "2018-04-11",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-12",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-13",
|
||||
"y": 22
|
||||
}, {
|
||||
"x": "2018-04-14",
|
||||
"y": 58
|
||||
}, {
|
||||
"x": "2018-04-15",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-16",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-17",
|
||||
"y": 19
|
||||
}, {
|
||||
"x": "2018-04-18",
|
||||
"y": 12
|
||||
}, {
|
||||
"x": "2018-04-19",
|
||||
"y": 19
|
||||
}],
|
||||
"total": 136,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": 0,
|
||||
"labels": null
|
||||
}
|
||||
}
|
||||
};
|
48
test/javascripts/fixtures/topics.js.es6
Normal file
48
test/javascripts/fixtures/topics.js.es6
Normal file
|
@ -0,0 +1,48 @@
|
|||
export default {
|
||||
"/admin/reports/topics": {
|
||||
"report": {
|
||||
"type": "topics",
|
||||
"title": "Topics",
|
||||
"xaxis": "Day",
|
||||
"yaxis": "Number of new topics",
|
||||
"data": [{
|
||||
"x": "2018-04-11",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-12",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-13",
|
||||
"y": 60
|
||||
}, {
|
||||
"x": "2018-04-14",
|
||||
"y": 60
|
||||
}, {
|
||||
"x": "2018-04-15",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-16",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-17",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-19",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-18",
|
||||
"y": 10
|
||||
}, {
|
||||
"x": "2018-04-20",
|
||||
"y": 1
|
||||
}],
|
||||
"total": 121,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": 0,
|
||||
"labels": null
|
||||
}
|
||||
}
|
||||
};
|
22
test/javascripts/fixtures/trending-search.js.es6
Normal file
22
test/javascripts/fixtures/trending-search.js.es6
Normal file
|
@ -0,0 +1,22 @@
|
|||
export default {
|
||||
"/admin/reports/trending_search": {
|
||||
"report": {
|
||||
"type": "trending_search",
|
||||
"title": "Trending search",
|
||||
"xaxis": "",
|
||||
"yaxis": "",
|
||||
"data": [
|
||||
["lon", 3, 1],
|
||||
["pub", 1, 1],
|
||||
["something", 1, 1]
|
||||
],
|
||||
"total": null,
|
||||
"start_date": "2018-03-26T00:00:00.000Z",
|
||||
"end_date": "2018-04-25T23:59:59.999Z",
|
||||
"category_id": null,
|
||||
"group_id": null,
|
||||
"prev30Days": null,
|
||||
"labels": ["Term", "Searches", "Unique"]
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user