We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d391162 commit bedfbdaCopy full SHA for bedfbda
ui/src/utils/numberFormats/numberFormats.test.ts
@@ -0,0 +1,22 @@
1
+import { bytesToMB, getTotalLabel } from '.'
2
+
3
+describe('bytesToMB', () => {
4
+ test('will convert bytes to MB', () => {
5
+ const sizeBytes = 1024 * 1024 * 30
6
+ const sizeMB = 30
7
+ const result = bytesToMB(sizeBytes)
8
+ expect(result).toEqual(sizeMB)
9
+ })
10
+})
11
12
+describe('getTotalLabel', () => {
13
+ test(`will show the sample length followed by a '+' if the known total is more than the sample length`, () => {
14
+ const result = getTotalLabel(10, 100)
15
+ expect(result).toEqual('10+')
16
17
18
+ test('will show the sample length if the known total is equal to the sample length', () => {
19
+ const result = getTotalLabel(10, 10)
20
+ expect(result).toEqual('10')
21
22
0 commit comments