diff options
author | NavaL <mnandri@thoughtworks.com> | 2016-01-11 17:54:53 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2016-01-11 17:54:53 +0100 |
commit | 0c6c8bed304884ab5f3ade69fb0d68d2cbe043e6 (patch) | |
tree | 1d95481fe628ac4878bc1c0670c9e4b50a10e9cc /web-ui/test | |
parent | 058d14143c179d9923eea433fc63094f4f9059aa (diff) |
format attachment size
Issue #573
Diffstat (limited to 'web-ui/test')
-rw-r--r-- | web-ui/test/spec/helpers/view_helper.spec.js | 25 | ||||
-rw-r--r-- | web-ui/test/spec/mixins/with_mail_edit_base.spec.js | 2 |
2 files changed, 26 insertions, 1 deletions
diff --git a/web-ui/test/spec/helpers/view_helper.spec.js b/web-ui/test/spec/helpers/view_helper.spec.js index 655ba181..92a31a1f 100644 --- a/web-ui/test/spec/helpers/view_helper.spec.js +++ b/web-ui/test/spec/helpers/view_helper.spec.js @@ -51,6 +51,31 @@ define(['helpers/view_helper'], function (viewHelper) { }); }); + describe('formatSize', function() { + var template; + beforeEach(function () { + template = Handlebars.compile('{{formatSize size}}'); + }); + + it('formats size to bytes', function() { + var bytes = 42; + var result = template({ size: bytes }); + expect(result).toEqual('42.00 b'); + }); + + it('formats size to kilobytes', function() { + var bytes = 4200; + var result = template({ size: bytes }); + expect(result).toEqual('4.10 Kb'); + }); + + it('formats size to megabytes', function() { + var bytes = 4200000; + var result = template({ size: bytes }); + expect(result).toEqual('4.01 Mb'); + }); + }); + describe('format status classes', function () { it('formats all the status of the email to css classes', function () { var statuses = ['read', 'banana']; diff --git a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js index f9e5600a..2b35d4f5 100644 --- a/web-ui/test/spec/mixins/with_mail_edit_base.spec.js +++ b/web-ui/test/spec/mixins/with_mail_edit_base.spec.js @@ -56,7 +56,7 @@ describeMixin('mixins/with_mail_edit_base', function () { setTimeout(function () { expect(saveDraftSpy).not.toHaveBeenTriggeredOn(document); done(); - }, 10); + }, 12); }); }); |