File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ describe('FocusOriginMonitor', () => {
2323 TestBed . compileComponents ( ) ;
2424 } ) ) ;
2525
26- beforeEach ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
26+ beforeEach ( async ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
2727 fixture = TestBed . createComponent ( PlainButton ) ;
2828 fixture . detectChanges ( ) ;
2929
@@ -32,7 +32,8 @@ describe('FocusOriginMonitor', () => {
3232 focusOriginMonitor = fom ;
3333
3434 focusOriginMonitor . registerElementForFocusClasses ( buttonElement , buttonRenderer ) ;
35- } ) ) ;
35+ document . body . focus ( ) ;
36+ } ) ) ) ;
3637
3738 it ( 'manually registered element should receive focus classes' , async ( ( ) => {
3839 buttonElement . focus ( ) ;
@@ -171,11 +172,6 @@ describe('cdkFocusClasses', () => {
171172 buttonElement = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
172173 } ) ;
173174
174- afterEach ( ( ) => {
175- buttonElement . blur ( ) ;
176- fixture . detectChanges ( ) ;
177- } ) ;
178-
179175 it ( 'should initially not be focused' , ( ) => {
180176 expect ( buttonElement . classList . length ) . toBe ( 0 , 'button should not have focus classes' ) ;
181177 } ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ export class FocusOriginMonitor {
1616 // TODO(mmalerba): Figure out how to handle touchstart
1717 document . addEventListener (
1818 'keydown' , ( ) => this . _setOriginForCurrentEventQueue ( 'keyboard' ) , true ) ;
19-
2019 document . addEventListener (
2120 'mousedown' , ( ) => this . _setOriginForCurrentEventQueue ( 'mouse' ) , true ) ;
2221 }
You can’t perform that action at this time.
0 commit comments