1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/utils/metricUnitsToNumber_test.ts
Sebastian Malton 0f84cf1016 resolve comments, add unit tests
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
2020-08-04 11:17:46 -04:00

15 lines
414 B
TypeScript

import { metricUnitsToNumber } from "./metricUnitsToNumber";
describe("metricUnitsToNumber tests", () => {
test("plain number", () => {
expect(metricUnitsToNumber("124")).toStrictEqual(124);
});
test("with k suffix", () => {
expect(metricUnitsToNumber("124k")).toStrictEqual(124000);
});
test("with m suffix", () => {
expect(metricUnitsToNumber("124m")).toStrictEqual(124000000);
});
});