File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,34 @@ describe('getPrice', () => {
107107 } ) ;
108108 } ) ;
109109
110+ it ( 'should handle Indian Rupee format' , ( ) => {
111+ const result = getPrice ( { formatted : '₹49.97' , locale : 'en-IN' } ) ;
112+ expect ( result ) . toEqual ( {
113+ amount : 49.97 ,
114+ formatted : '₹49.97' ,
115+ } ) ;
116+ } ) ;
117+
118+ it ( 'should handle Swedish Krona format with symbol after amount' , ( ) => {
119+ const result = getPrice ( {
120+ formatted : '1499,00 kr' ,
121+ locale : 'sv-SE' ,
122+ divideBy : 30 , // Convert monthly to daily price
123+ } ) ;
124+ expect ( result ) . toEqual ( {
125+ amount : 49.97 ,
126+ formatted : '49,97 kr' ,
127+ } ) ;
128+ } ) ;
129+
130+ it ( 'should handle Brazilian Real format with specific spacing' , ( ) => {
131+ const result = getPrice ( { formatted : 'R$ 149,90' , locale : 'pt-BR' } ) ;
132+ expect ( result ) . toEqual ( {
133+ amount : 149.9 ,
134+ formatted : 'R$ 149,90' ,
135+ } ) ;
136+ } ) ;
137+
110138 // we have not covered the case where there are multiple spaces within the format and negative values
111139} ) ;
112140
You can’t perform that action at this time.
0 commit comments