@@ -6,10 +6,10 @@ describe('data-storage-unit-converter', () => {
6
6
it ( 'convert from same base units' , ( ) => {
7
7
expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 * 1024 , fromUnit : 'B' , toUnit : 'MiB' } ) ) . toBe ( '1' ) ;
8
8
expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 , fromUnit : 'KiB' , toUnit : 'MiB' } ) ) . toBe ( '1' ) ;
9
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MiB' , toUnit : 'KiB' } ) ) . toBe ( '1,024 ' ) ;
9
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MiB' , toUnit : 'KiB' } ) ) . toBe ( '1024 ' ) ;
10
10
expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'MB' , toUnit : 'GB' } ) ) . toBe ( '1' ) ;
11
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 , fromUnit : 'MB' , toUnit : 'MB' } ) ) . toBe ( '1,024 ' ) ;
12
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MB' , toUnit : 'KB' } ) ) . toBe ( '1,000 ' ) ;
11
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 , fromUnit : 'MB' , toUnit : 'MB' } ) ) . toBe ( '1024 ' ) ;
12
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MB' , toUnit : 'KB' } ) ) . toBe ( '1000 ' ) ;
13
13
expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 , fromUnit : 'MiB' , toUnit : 'GiB' } ) ) . toBe ( '1' ) ;
14
14
expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'MB' , toUnit : 'GB' } ) ) . toBe ( '1' ) ;
15
15
expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'Mb' , toUnit : 'Gb' } ) ) . toBe ( '1' ) ;
@@ -20,16 +20,16 @@ describe('data-storage-unit-converter', () => {
20
20
expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MiB' , toUnit : 'MB' } ) ) . toBe ( '1.049' ) ;
21
21
expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 * 1000 , fromUnit : 'B' , toUnit : 'MiB' } ) ) . toBe ( '0.954' ) ;
22
22
expect ( convertStorageAndRateUnitsDisplay ( { value : 1024 , fromUnit : 'KB' , toUnit : 'MiB' } ) ) . toBe ( '0.977' ) ;
23
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'MiB' , toUnit : 'MB' } ) ) . toBe ( '1,048 .576' ) ;
23
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'MiB' , toUnit : 'MB' } ) ) . toBe ( '1048 .576' ) ;
24
24
expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MB' , toUnit : 'Mb' } ) ) . toBe ( '8' ) ;
25
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'KB' , toUnit : 'Kb' } ) ) . toBe ( '8,000 ' ) ;
26
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'KiB' , toUnit : 'Kb' } ) ) . toBe ( '8,192 ' ) ;
25
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'KB' , toUnit : 'Kb' } ) ) . toBe ( '8000 ' ) ;
26
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1000 , fromUnit : 'KiB' , toUnit : 'Kb' } ) ) . toBe ( '8192 ' ) ;
27
27
expect ( convertStorageAndRateUnitsDisplay ( { value : 8 , fromUnit : 'Mb' , toUnit : 'MB' } ) ) . toBe ( '1' ) ;
28
28
29
29
expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'Mb' , toUnit : 'KB' } ) ) . toBe ( '125' ) ;
30
30
expect ( convertStorageAndRateUnitsDisplay ( { value : 125 , fromUnit : 'KB' , toUnit : 'Mb' } ) ) . toBe ( '1' ) ;
31
31
32
- expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MiB' , toUnit : 'Kb' } ) ) . toBe ( '8,388 .608' ) ;
32
+ expect ( convertStorageAndRateUnitsDisplay ( { value : 1 , fromUnit : 'MiB' , toUnit : 'Kb' } ) ) . toBe ( '8388 .608' ) ;
33
33
expect ( convertStorageAndRateUnitsDisplay ( { value : 8388.608 , fromUnit : 'Kb' , toUnit : 'MiB' } ) ) . toBe ( '1' ) ;
34
34
} ) ;
35
35
it ( 'convert with unit display' , ( ) => {
0 commit comments