@@ -80,8 +80,8 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
8080 } ) ;
8181
8282 beforeEach ( ( ) => {
83- onChangeSpy = testRunnerResolver . createSpy ( ) ;
84- onTouchedSpy = testRunnerResolver . createSpy ( ) ;
83+ onChangeSpy = testRunnerResolver . createSpy ( 'onChangeSpy' ) ;
84+ onTouchedSpy = testRunnerResolver . createSpy ( 'onTouchedSpy' ) ;
8585
8686 registerOnChangeSpy = testRunnerResolver . spyOn ( componentInstance , 'registerOnChange' ) ;
8787 registerOnTouchedSpy = testRunnerResolver . spyOn ( componentInstance , 'registerOnTouched' ) ;
@@ -96,9 +96,9 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
9696 fixture . detectChanges ( ) ;
9797 }
9898
99- function expectComponentValueToBe ( expected : any ) : void {
99+ function expectComponentValueToEqual ( expected : any ) : void {
100100 if ( typeof config . getComponentValue === 'function' ) {
101- expect ( config . getComponentValue ( fixture ) ) . toBe ( expected ) ;
101+ expect ( config . getComponentValue ( fixture ) ) . toEqual ( expected ) ;
102102 }
103103 }
104104
@@ -121,7 +121,7 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
121121 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
122122 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
123123 expect ( setDisabledStateSpy ) . toHaveBeenCalledTimes ( 0 ) ;
124- expectComponentValueToBe ( getValuesFn ( ) [ 0 ] ) ;
124+ expectComponentValueToEqual ( getValuesFn ( ) [ 0 ] ) ;
125125 } ) ;
126126
127127 it ( 'value set externally' , fakeAsync ( ( ) => {
@@ -134,14 +134,14 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
134134 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
135135 componentInstance . writeValue ( getValuesFn ( ) [ 1 ] ) ;
136136 tick ( config . customDelay ?? 100 ) ;
137- expectComponentValueToBe ( getValuesFn ( ) [ 1 ] ) ;
137+ expectComponentValueToEqual ( getValuesFn ( ) [ 1 ] ) ;
138138 expect ( writeValueSpy ) . toHaveBeenCalledTimes ( 2 ) ;
139139 testRunnerResolver . expectToHaveBeenNthCalledWith ( writeValueSpy , 2 , [ getValuesFn ( ) [ 1 ] ] ) ;
140140 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
141141 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
142142 componentInstance . writeValue ( getValuesFn ( ) [ 2 ] ) ;
143143 tick ( config . customDelay ?? 100 ) ;
144- expectComponentValueToBe ( getValuesFn ( ) [ 2 ] ) ;
144+ expectComponentValueToEqual ( getValuesFn ( ) [ 2 ] ) ;
145145 expect ( writeValueSpy ) . toHaveBeenCalledTimes ( 3 ) ;
146146 testRunnerResolver . expectToHaveBeenNthCalledWith ( writeValueSpy , 3 , [ getValuesFn ( ) [ 2 ] ] ) ;
147147 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -153,14 +153,14 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
153153 expect ( writeValueSpy ) . toHaveBeenCalledTimes ( 1 ) ;
154154 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
155155 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
156- expectComponentValueToBe ( getValuesFn ( ) [ 0 ] ) ;
156+ expectComponentValueToEqual ( getValuesFn ( ) [ 0 ] ) ;
157157 componentInstance . writeValue ( null ) ;
158158 tick ( config . customDelay ?? 100 ) ;
159159 expect ( writeValueSpy ) . toHaveBeenCalledTimes ( 2 ) ;
160160 testRunnerResolver . expectToHaveBeenNthCalledWith ( writeValueSpy , 2 , [ null ] ) ;
161161 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
162162 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
163- expectComponentValueToBe ( config . resetCustomValue ? config . resetCustomValue . value : null ) ;
163+ expectComponentValueToEqual ( config . resetCustomValue ? config . resetCustomValue . value : null ) ;
164164 } ) ) ;
165165
166166 if ( ! config . disabledStateNotSupported ) {
@@ -170,7 +170,7 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
170170 componentInstance . setDisabledState ( true ) ;
171171 tick ( config . customDelay ?? 100 ) ;
172172 componentInstance . writeValue ( getValuesFn ( ) [ 1 ] ) ;
173- expectComponentValueToBe ( getValuesFn ( ) [ 1 ] ) ;
173+ expectComponentValueToEqual ( getValuesFn ( ) [ 1 ] ) ;
174174 testRunnerResolver . expectToHaveBeenNthCalledWith ( writeValueSpy , 2 , [ getValuesFn ( ) [ 1 ] ] ) ;
175175 expect ( setDisabledStateSpy ) . toHaveBeenCalledTimes ( 1 ) ;
176176 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -180,7 +180,7 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
180180 tick ( config . customDelay ?? 100 ) ;
181181 componentInstance . writeValue ( getValuesFn ( ) [ 2 ] ) ;
182182 tick ( config . customDelay ?? 100 ) ;
183- expectComponentValueToBe ( getValuesFn ( ) [ 2 ] ) ;
183+ expectComponentValueToEqual ( getValuesFn ( ) [ 2 ] ) ;
184184 testRunnerResolver . expectToHaveBeenNthCalledWith ( writeValueSpy , 3 , [ getValuesFn ( ) [ 2 ] ] ) ;
185185 expect ( setDisabledStateSpy ) . toHaveBeenCalledTimes ( 2 ) ;
186186 expect ( onChangeSpy ) . toHaveBeenCalledTimes ( 0 ) ;
@@ -199,7 +199,7 @@ export function runValueAccessorTests<T extends CVAComponentType, H = T>(config:
199199 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( 0 ) ;
200200 config . internalValueChangeSetter ! ( fixture , getValuesFn ( ) [ 1 ] ) ;
201201 tick ( config . customDelay ?? 100 ) ;
202- expectComponentValueToBe ( getValuesFn ( ) [ 1 ] ) ;
202+ expectComponentValueToEqual ( getValuesFn ( ) [ 1 ] ) ;
203203 testRunnerResolver . expectToHaveBeenNthCalledWith ( onChangeSpy , 1 , [ getValuesFn ( ) [ 1 ] ] ) ;
204204 expect ( onTouchedSpy ) . toHaveBeenCalledTimes ( config . supportsOnBlur ? 0 : 1 ) ;
205205 } ) ) ;
0 commit comments