admin_settings: Change maxfilesize to max_file_upload_size.

Renamed maxfilesize to max_file_upload_size for consistency.
Related to #12152.
This commit is contained in:
vinitS101
2019-05-03 21:25:04 +05:30
committed by Tim Abbott
parent 3cb502974e
commit 81b5a72252
6 changed files with 15 additions and 13 deletions

View File

@@ -830,7 +830,7 @@ function verify_filedrop_payload(payload) {
assert.equal(payload.url, '/json/user_uploads');
assert.equal(payload.fallback_id, 'file_input');
assert.equal(payload.paramname, 'file');
assert.equal(payload.maxfilesize, 512);
assert.equal(payload.max_file_upload_size, 512);
assert.equal(payload.data.csrfmiddlewaretoken, 'fake-csrf-token');
assert.deepEqual(payload.raw_droppable, ['text/uri-list', 'text/plain']);
assert.equal(typeof payload.drop, 'function');
@@ -888,7 +888,7 @@ run_test('initialize', () => {
global.csrf_token = 'fake-csrf-token';
var filedrop_in_compose_checked = false;
page_params.maxfilesize = 512;
page_params.max_file_upload_size = 512;
$("#compose").filedrop = function (payload) {
verify_filedrop_payload(payload);
test_raw_file_drop(payload.rawDrop);

View File

@@ -6,7 +6,9 @@ set_global('navigator', {
userAgent: 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)',
});
set_global('i18n', global.stub_i18n);
set_global('page_params', { });
set_global('page_params', {
max_file_upload_size: 25,
});
set_global('csrf_token', { });
global.patch_builtin('window', {
bridge: false,
@@ -96,7 +98,7 @@ run_test('upload_error', () => {
var msg_prefix = 'translated: ';
var msg_1 = 'File upload is not yet available for your browser.';
var msg_2 = 'Unable to upload that many files at once.';
var msg_3 = '"foobar.txt" was too large; the maximum file size is 25MiB.';
var msg_3 = '"foobar.txt" was too large; the maximum file size is 25MB.';
var msg_4 = 'Sorry, the file was too large.';
var msg_5 = 'An unknown error occurred.';