@@ -27,13 +27,13 @@ describe('MoneyEditComponent', () => {
2727
2828 fixture = TestBed . createComponent ( MoneyEditComponent ) ;
2929 component = fixture . componentInstance ;
30-
30+
3131 // Set required properties from base component
3232 component . label = 'Test Money' ;
3333 component . required = false ;
3434 component . disabled = false ;
3535 component . readonly = false ;
36-
36+
3737 fixture . detectChanges ( ) ;
3838 } ) ;
3939
@@ -87,9 +87,9 @@ describe('MoneyEditComponent', () => {
8787 component . selectedCurrency = 'EUR' ;
8888 component . amount = 100 ;
8989 spyOn ( component . onFieldChange , 'emit' ) ;
90-
90+
9191 component . onCurrencyChange ( ) ;
92-
92+
9393 expect ( component . onFieldChange . emit ) . toHaveBeenCalledWith ( {
9494 amount : 100 ,
9595 currency : 'EUR'
@@ -100,9 +100,9 @@ describe('MoneyEditComponent', () => {
100100 component . displayAmount = '123.45' ;
101101 component . selectedCurrency = 'USD' ;
102102 spyOn ( component . onFieldChange , 'emit' ) ;
103-
103+
104104 component . onAmountChange ( ) ;
105-
105+
106106 expect ( component . amount ) . toBe ( 123.45 ) ;
107107 expect ( component . onFieldChange . emit ) . toHaveBeenCalledWith ( 123.45 ) ;
108108 } ) ;
@@ -112,9 +112,9 @@ describe('MoneyEditComponent', () => {
112112 component . displayAmount = '123.45' ;
113113 component . selectedCurrency = 'USD' ;
114114 spyOn ( component . onFieldChange , 'emit' ) ;
115-
115+
116116 component . onAmountChange ( ) ;
117-
117+
118118 expect ( component . amount ) . toBe ( 123.45 ) ;
119119 expect ( component . onFieldChange . emit ) . toHaveBeenCalledWith ( {
120120 amount : 123.45 ,
@@ -125,40 +125,39 @@ describe('MoneyEditComponent', () => {
125125 it ( 'should handle invalid amount input with letters' , ( ) => {
126126 component . amount = 100 ;
127127 component . displayAmount = 'abc123def' ; // Contains letters which get stripped
128-
128+
129129 component . onAmountChange ( ) ;
130130 component . onAmountBlur ( ) ;
131-
131+
132132 expect ( component . amount ) . toBe ( 123 ) ;
133133 expect ( component . displayAmount ) . toBe ( '123.00' ) ;
134134 } ) ;
135135
136136 it ( 'should handle completely invalid input' , ( ) => {
137137 component . amount = 100 ;
138138 component . displayAmount = 'invalid' ; // All letters, becomes empty after strip
139-
139+
140140 component . onAmountChange ( ) ;
141-
142- // @ts -expect-error
141+
143142 expect ( component . amount ) . toBe ( '' ) ;
144143 expect ( component . displayAmount ) . toBe ( '' ) ;
145144 } ) ;
146145
147146 it ( 'should handle invalid amount input when amount is empty' , ( ) => {
148147 component . amount = '' ;
149148 component . displayAmount = 'invalid' ;
150-
149+
151150 component . onAmountChange ( ) ;
152-
151+
153152 expect ( component . displayAmount ) . toBe ( '' ) ;
154153 } ) ;
155154
156155 it ( 'should respect allow_negative configuration' , ( ) => {
157156 component . allowNegative = false ;
158157 component . displayAmount = '-123.45' ;
159-
158+
160159 component . onAmountChange ( ) ;
161-
160+
162161 expect ( component . amount ) . toBe ( 123.45 ) ;
163162 } ) ;
164163
@@ -175,9 +174,9 @@ describe('MoneyEditComponent', () => {
175174 allow_negative : false
176175 }
177176 } ;
178-
177+
179178 component . configureFromWidgetParams ( ) ;
180-
179+
181180 expect ( component . defaultCurrency ) . toBe ( 'EUR' ) ;
182181 expect ( component . showCurrencySelector ) . toBe ( true ) ;
183182 expect ( component . decimalPlaces ) . toBe ( 3 ) ;
@@ -187,25 +186,25 @@ describe('MoneyEditComponent', () => {
187186 it ( 'should return correct display value' , ( ) => {
188187 component . amount = 123.45 ;
189188 component . selectedCurrency = 'USD' ;
190-
189+
191190 const displayValue = component . displayValue ;
192-
191+
193192 expect ( displayValue ) . toBe ( '$123.45' ) ;
194193 } ) ;
195194
196195 it ( 'should return correct placeholder' , ( ) => {
197196 component . selectedCurrency = 'EUR' ;
198-
197+
199198 const placeholder = component . placeholder ;
200-
199+
201200 expect ( placeholder ) . toBe ( 'Enter amount in Euro' ) ;
202201 } ) ;
203202
204203 it ( 'should find selected currency data' , ( ) => {
205204 component . selectedCurrency = 'GBP' ;
206-
205+
207206 const currencyData = component . selectedCurrencyData ;
208-
207+
209208 expect ( currencyData . code ) . toBe ( 'GBP' ) ;
210209 expect ( currencyData . name ) . toBe ( 'British Pound' ) ;
211210 expect ( currencyData . symbol ) . toBe ( '£' ) ;
@@ -214,9 +213,9 @@ describe('MoneyEditComponent', () => {
214213 it ( 'should emit empty value when amount is cleared' , ( ) => {
215214 component . amount = '' ;
216215 spyOn ( component . onFieldChange , 'emit' ) ;
217-
216+
218217 component . updateValue ( ) ;
219-
218+
220219 expect ( component . onFieldChange . emit ) . toHaveBeenCalledWith ( '' ) ;
221220 } ) ;
222- } ) ;
221+ } ) ;
0 commit comments