@@ -209,7 +209,9 @@ describe('FocusOriginMonitor', () => {
209209 . toBe ( 2 , 'button should have exactly 2 focus classes' ) ;
210210 expect ( changeHandler ) . toHaveBeenCalledWith ( 'program' ) ;
211211
212- buttonElement . blur ( ) ;
212+ // Call `blur` directly because invoking `buttonElement.blur()` does not always trigger the
213+ // handler on IE11 on SauceLabs.
214+ focusOriginMonitor . _onBlur ( { } as any , buttonElement ) ;
213215 fixture . detectChanges ( ) ;
214216
215217 expect ( buttonElement . classList . length )
@@ -238,6 +240,7 @@ describe('FocusOriginMonitor', () => {
238240
239241
240242describe ( 'cdkMonitorFocus' , ( ) => {
243+ let focusOriginMonitor : FocusOriginMonitor ;
241244 beforeEach ( async ( ( ) => {
242245 TestBed . configureTestingModule ( {
243246 imports : [ StyleModule ] ,
@@ -251,6 +254,10 @@ describe('cdkMonitorFocus', () => {
251254 TestBed . compileComponents ( ) ;
252255 } ) ) ;
253256
257+ beforeEach ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
258+ focusOriginMonitor = fom ;
259+ } ) ) ;
260+
254261 describe ( 'button with cdkMonitorElementFocus' , ( ) => {
255262 let fixture : ComponentFixture < ButtonWithFocusClasses > ;
256263 let buttonElement : HTMLElement ;
@@ -356,7 +363,9 @@ describe('cdkMonitorFocus', () => {
356363 . toBe ( 2 , 'button should have exactly 2 focus classes' ) ;
357364 expect ( fixture . componentInstance . focusChanged ) . toHaveBeenCalledWith ( 'program' ) ;
358365
359- buttonElement . blur ( ) ;
366+ // Call `blur` directly because invoking `buttonElement.blur()` does not always trigger the
367+ // handler on IE11 on SauceLabs.
368+ focusOriginMonitor . _onBlur ( { } as any , buttonElement ) ;
360369 fixture . detectChanges ( ) ;
361370
362371 expect ( buttonElement . classList . length )
0 commit comments