mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-22 06:28:46 -04:00
Show file name and size on download page
This commit is contained in:
parent
409af9b991
commit
d01c37c59d
42 changed files with 373 additions and 3 deletions
|
@ -290,5 +290,31 @@ describe('Helper', function () {
|
|||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('formatBytes', function () {
|
||||
jsc.property('returns 0 B for 0 bytes', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(0) === '0 B';
|
||||
});
|
||||
|
||||
jsc.property('formats bytes < 1000 as B', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(500) === '500 B';
|
||||
});
|
||||
|
||||
jsc.property('formats kilobytes correctly', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(1500) === '1.5 KB';
|
||||
});
|
||||
|
||||
jsc.property('formats megabytes correctly', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(2 * 1000 * 1000) === '2 MB';
|
||||
});
|
||||
|
||||
jsc.property('formats gigabytes correctly', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(3.45 * 1000 * 1000 * 1000) === '3.45 GB';
|
||||
});
|
||||
|
||||
jsc.property('rounds to two decimal places', function () {
|
||||
return $.PrivateBin.Helper.formatBytes(1234567) === '1.23 MB';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue