aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/tests/utils.js
blob: 1b6de26431b09a3fce388fb2cb332b45887ec000 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
jest.dontMock("jquery");
jest.dontMock("../utils");

describe("utils", function () {
    import {formatSize} from "../utils.js"
    it("formatSize", function(){
        expect(formatSize(1024)).toEqual("1kb");
        expect(formatSize(0)).toEqual("0");
        expect(formatSize(10)).toEqual("10b");
        expect(formatSize(1025)).toEqual("1.0kb");
        expect(formatSize(1024*1024)).toEqual("1mb");
        expect(formatSize(1024*1024+1)).toEqual("1.0mb");
    });
});