@@ -379,27 +379,31 @@ describe('MDCChipFoundation', () => {
379379 const mockEvt = {
380380 type : 'click' ,
381381 stopPropagation : jasmine . createSpy ( 'stopPropagation' ) ,
382+ preventDefault : jasmine . createSpy ( 'preventDefault' ) ,
382383 key : '' ,
383384 } ;
384385
385386 foundation . handleTrailingIconInteraction ( mockEvt ) ;
386387 expect ( mockAdapter . notifyTrailingIconInteraction )
387388 . toHaveBeenCalledTimes ( 1 ) ;
388389 expect ( mockEvt . stopPropagation ) . toHaveBeenCalledTimes ( 1 ) ;
390+ expect ( mockEvt . preventDefault ) . toHaveBeenCalledTimes ( 1 ) ;
389391
390392 mockEvt . type = 'keydown' ;
391393 mockEvt . key = ' ' ;
392394 foundation . handleTrailingIconInteraction ( mockEvt ) ;
393395 expect ( mockAdapter . notifyTrailingIconInteraction )
394396 . toHaveBeenCalledTimes ( 2 ) ;
395397 expect ( mockEvt . stopPropagation ) . toHaveBeenCalledTimes ( 2 ) ;
398+ expect ( mockEvt . preventDefault ) . toHaveBeenCalledTimes ( 2 ) ;
396399
397400 mockEvt . type = 'keydown' ;
398401 mockEvt . key = 'Enter' ;
399402 foundation . handleTrailingIconInteraction ( mockEvt ) ;
400403 expect ( mockAdapter . notifyTrailingIconInteraction )
401404 . toHaveBeenCalledTimes ( 3 ) ;
402405 expect ( mockEvt . stopPropagation ) . toHaveBeenCalledTimes ( 3 ) ;
406+ expect ( mockEvt . preventDefault ) . toHaveBeenCalledTimes ( 3 ) ;
403407 } ) ;
404408
405409 it ( `#handleTrailingIconInteraction adds ${
@@ -409,13 +413,15 @@ describe('MDCChipFoundation', () => {
409413 const mockEvt = {
410414 type : 'click' ,
411415 stopPropagation : jasmine . createSpy ( 'stopPropagation' ) ,
416+ preventDefault : jasmine . createSpy ( 'preventDefault' ) ,
412417 } ;
413418
414419 foundation . handleTrailingIconInteraction ( mockEvt ) ;
415420
416421 expect ( foundation . getShouldRemoveOnTrailingIconClick ( ) ) . toBe ( true ) ;
417422 expect ( mockAdapter . addClass ) . toHaveBeenCalledWith ( cssClasses . CHIP_EXIT ) ;
418423 expect ( mockEvt . stopPropagation ) . toHaveBeenCalled ( ) ;
424+ expect ( mockEvt . preventDefault ) . toHaveBeenCalled ( ) ;
419425 } ) ;
420426
421427 it ( `#handleTrailingIconInteraction does not add ${
@@ -426,6 +432,7 @@ describe('MDCChipFoundation', () => {
426432 const mockEvt = {
427433 type : 'click' ,
428434 stopPropagation : jasmine . createSpy ( 'stopPropagation' ) ,
435+ preventDefault : jasmine . createSpy ( 'preventDefault' ) ,
429436 } ;
430437
431438 foundation . setShouldRemoveOnTrailingIconClick ( false ) ;
@@ -435,6 +442,7 @@ describe('MDCChipFoundation', () => {
435442 expect ( mockAdapter . addClass )
436443 . not . toHaveBeenCalledWith ( cssClasses . CHIP_EXIT ) ;
437444 expect ( mockEvt . stopPropagation ) . toHaveBeenCalled ( ) ;
445+ expect ( mockEvt . preventDefault ) . toHaveBeenCalled ( ) ;
438446 } ) ;
439447
440448 it ( '#handleKeydown emits custom event with appropriate keys' , ( ) => {
0 commit comments