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', () => {
23
23
TestBed . compileComponents ( ) ;
24
24
} ) ) ;
25
25
26
- beforeEach ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
26
+ beforeEach ( async ( inject ( [ FocusOriginMonitor ] , ( fom : FocusOriginMonitor ) => {
27
27
fixture = TestBed . createComponent ( PlainButton ) ;
28
28
fixture . detectChanges ( ) ;
29
29
@@ -32,7 +32,8 @@ describe('FocusOriginMonitor', () => {
32
32
focusOriginMonitor = fom ;
33
33
34
34
focusOriginMonitor . registerElementForFocusClasses ( buttonElement , buttonRenderer ) ;
35
- } ) ) ;
35
+ document . body . focus ( ) ;
36
+ } ) ) ) ;
36
37
37
38
it ( 'manually registered element should receive focus classes' , async ( ( ) => {
38
39
buttonElement . focus ( ) ;
@@ -171,11 +172,6 @@ describe('cdkFocusClasses', () => {
171
172
buttonElement = fixture . debugElement . query ( By . css ( 'button' ) ) . nativeElement ;
172
173
} ) ;
173
174
174
- afterEach ( ( ) => {
175
- buttonElement . blur ( ) ;
176
- fixture . detectChanges ( ) ;
177
- } ) ;
178
-
179
175
it ( 'should initially not be focused' , ( ) => {
180
176
expect ( buttonElement . classList . length ) . toBe ( 0 , 'button should not have focus classes' ) ;
181
177
} ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ export class FocusOriginMonitor {
16
16
// TODO(mmalerba): Figure out how to handle touchstart
17
17
document . addEventListener (
18
18
'keydown' , ( ) => this . _setOriginForCurrentEventQueue ( 'keyboard' ) , true ) ;
19
-
20
19
document . addEventListener (
21
20
'mousedown' , ( ) => this . _setOriginForCurrentEventQueue ( 'mouse' ) , true ) ;
22
21
}
You can’t perform that action at this time.
0 commit comments