@@ -97,12 +97,10 @@ describe('igxCombo', () => {
9797
9898 // writeValue
9999 expect ( combo . value ) . toBe ( '' ) ;
100- mockSelection . add_items . and . returnValue ( new Set ( [ 'test' ] ) ) ;
100+ mockSelection . get . and . returnValue ( new Set ( [ 'test' ] ) ) ;
101101 spyOnProperty ( combo , 'isRemote' ) . and . returnValue ( false ) ;
102102 combo . writeValue ( [ 'test' ] ) ;
103- // TODO: Uncomment after fix for write value going through entire selection process
104- // expect(mockNgControl.registerOnChangeCb).not.toHaveBeenCalled();
105- expect ( mockSelection . add_items ) . toHaveBeenCalledWith ( combo . id , [ 'test' ] , true ) ;
103+ expect ( mockNgControl . registerOnChangeCb ) . not . toHaveBeenCalled ( ) ;
106104 expect ( mockSelection . select_items ) . toHaveBeenCalledWith ( combo . id , [ 'test' ] , true ) ;
107105 expect ( combo . value ) . toBe ( 'test' ) ;
108106
@@ -207,17 +205,18 @@ describe('igxCombo', () => {
207205 spyOn ( mockIconService , 'addSvgIconFromText' ) . and . returnValue ( null ) ;
208206 combo . ngOnInit ( ) ;
209207 combo . data = data ;
210- spyOn ( combo , 'selectItems' ) ;
208+ mockSelection . select_items . calls . reset ( ) ;
209+ spyOnProperty ( combo , 'isRemote' ) . and . returnValue ( false ) ;
211210 combo . writeValue ( [ 'EXAMPLE' ] ) ;
212- expect ( combo . selectItems ) . toHaveBeenCalledTimes ( 1 ) ;
211+ expect ( mockSelection . select_items ) . toHaveBeenCalledTimes ( 1 ) ;
213212
214- // Calling "SelectItems " through the writeValue accessor should clear the previous values;
213+ // Calling "select_items " through the writeValue accessor should clear the previous values;
215214 // Select items is called with the invalid value and it is written in selection, though no item is selected
216215 // Controlling the selection is up to the user
217- expect ( combo . selectItems ) . toHaveBeenCalledWith ( [ 'EXAMPLE' ] , true ) ;
216+ expect ( mockSelection . select_items ) . toHaveBeenCalledWith ( combo . id , [ 'EXAMPLE' ] , true ) ;
218217 combo . writeValue ( combo . data [ 0 ] ) ;
219218 // When value key is specified, the item's value key is stored in the selection
220- expect ( combo . selectItems ) . toHaveBeenCalledWith ( combo . data [ 0 ] , true ) ;
219+ expect ( mockSelection . select_items ) . toHaveBeenCalledWith ( combo . id , [ ] , true ) ;
221220 } ) ;
222221 it ( 'should select items through setSelctedItem method' , ( ) => {
223222 const selectionService = new IgxSelectionAPIService ( ) ;
0 commit comments