diff options
Diffstat (limited to 'web/src/js/tests')
-rw-r--r-- | web/src/js/tests/utils.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web/src/js/tests/utils.js b/web/src/js/tests/utils.js new file mode 100644 index 00000000..dfbb9ba6 --- /dev/null +++ b/web/src/js/tests/utils.js @@ -0,0 +1,15 @@ +jest.dontMock("jquery"); +jest.dontMock("../utils"); + +describe("utils", function () { + var utils = require("../utils"); + it("formatSize", function(){ + expect(utils.formatSize(1024)).toEqual("1kb"); + expect(utils.formatSize(0)).toEqual("0"); + expect(utils.formatSize(10)).toEqual("10b"); + expect(utils.formatSize(1025)).toEqual("1.0kb"); + expect(utils.formatSize(1024*1024)).toEqual("1mb"); + expect(utils.formatSize(1024*1024+1)).toEqual("1.0mb"); + }); +}); + |