diff options
Diffstat (limited to 'web-ui/test/spec')
-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); }); }); |