FEATURE: Add Top Uploads report (#6825)

Co-Authored-By: I am very Pro-Grammer. <khalilovcmded@users.noreply.github.com>
This commit is contained in:
Joffrey JAFFEUX
2018-12-28 20:48:54 +01:00
committed by GitHub
parent 608abd4c08
commit f1269fa807
5 changed files with 136 additions and 2 deletions

View File

@ -404,7 +404,8 @@ QUnit.test("computed labels", assert => {
topic_id: 2,
topic_title: "Test topic",
post_number: 3,
post_raw: "This is the beginning of"
post_raw: "This is the beginning of",
filesize: 582641
}
];
@ -437,7 +438,8 @@ QUnit.test("computed labels", assert => {
truncated_raw: "post_raw"
},
title: "Post"
}
},
{ type: "bytes", property: "filesize", title: "Filesize" }
];
const report = Report.create({
@ -516,6 +518,15 @@ QUnit.test("computed labels", assert => {
);
assert.equal(computedPostLabel.value, "This is the beginning of");
const filesizeLabel = computedLabels[6];
assert.equal(filesizeLabel.mainProperty, "filesize");
assert.equal(filesizeLabel.sortProperty, "filesize");
assert.equal(filesizeLabel.title, "Filesize");
assert.equal(filesizeLabel.type, "bytes");
const computedFilesizeLabel = filesizeLabel.compute(row);
assert.equal(computedFilesizeLabel.formatedValue, "569.0 KB");
assert.equal(computedFilesizeLabel.value, 582641);
// subfolder support
Discourse.BaseUri = "/forum";