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

import {formatSize} from "../utils.js"

describe("utils", function () {
    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");
    });
});