@@ -63,9 +63,9 @@ describe('profileHelper', () => {
6363 } ) ;
6464
6565 describe ( 'formatNumber' , ( ) => {
66- it ( 'should divide by 1000 and return string' , ( ) => {
67- expect ( formatNumber ( 1500 ) ) . toBe ( '1.5 ' ) ;
68- expect ( formatNumber ( 10000 ) ) . toBe ( '10 ' ) ;
66+ it ( 'should return string' , ( ) => {
67+ expect ( formatNumber ( 0.014999999 ) ) . toBe ( '0.015 ' ) ;
68+ expect ( formatNumber ( 0.12 ) ) . toBe ( '0.12 ' ) ;
6969 } ) ;
7070 } ) ;
7171
@@ -76,9 +76,9 @@ describe('profileHelper', () => {
7676 { id : '2' , name : 'Item2' , description : '' , group : '' , options : { str : 3 } , updatedAt : 1 }
7777 ] ;
7878 const result = calculateTotalOptions ( items ) ;
79- // 1 * 1000 + 3 * 1000 = 4000
80- expect ( result [ 'str' ] ) . toBe ( 4000 ) ;
81- expect ( result [ 'dex' ] ) . toBe ( 2000 ) ;
79+ // 1 * 1 + 3 * 1 = 4
80+ expect ( result [ 'str' ] ) . toBe ( 4 ) ;
81+ expect ( result [ 'dex' ] ) . toBe ( 2 ) ;
8282 } ) ;
8383
8484 it ( 'should handle special options' , ( ) => {
@@ -95,7 +95,7 @@ describe('profileHelper', () => {
9595 ] ;
9696 const result = calculateTotalOptions ( items ) ;
9797 // Should use 'after'
98- expect ( result [ 'str' ] ) . toBe ( 5000 ) ;
98+ expect ( result [ 'str' ] ) . toBe ( 5 ) ;
9999 } ) ;
100100
101101 it ( 'should handle special options (before)' , ( ) => {
@@ -112,7 +112,7 @@ describe('profileHelper', () => {
112112 ] ;
113113 const result = calculateTotalOptions ( items ) ;
114114 // Should use 'before'
115- expect ( result [ 'str' ] ) . toBe ( 1000 ) ;
115+ expect ( result [ 'str' ] ) . toBe ( 1 ) ;
116116 } ) ;
117117 } ) ;
118118
0 commit comments