@@ -26,7 +26,7 @@ import {
2626 MatMenuItem ,
2727} from './index' ;
2828import { MENU_PANEL_TOP_PADDING } from './menu-trigger' ;
29- import { extendObject , MatRipple } from '@angular/material/core' ;
29+ import { MatRipple } from '@angular/material/core' ;
3030import {
3131 dispatchKeyboardEvent ,
3232 dispatchMouseEvent ,
@@ -438,11 +438,11 @@ describe('MatMenu', () => {
438438 */
439439 class OverlapSubject < T extends TestableMenu > {
440440 readonly fixture : ComponentFixture < T > ;
441- readonly trigger : any ;
441+ readonly trigger : HTMLElement ;
442442
443443 constructor ( ctor : { new ( ) : T ; } , inputs : { [ key : string ] : any } = { } ) {
444444 this . fixture = TestBed . createComponent ( ctor ) ;
445- extendObject ( this . fixture . componentInstance , inputs ) ;
445+ Object . keys ( inputs ) . forEach ( key => this . fixture . componentInstance [ key ] = inputs [ key ] ) ;
446446 this . fixture . detectChanges ( ) ;
447447 this . trigger = this . fixture . componentInstance . triggerEl . nativeElement ;
448448 }
@@ -452,11 +452,6 @@ describe('MatMenu', () => {
452452 this . fixture . detectChanges ( ) ;
453453 }
454454
455- updateTriggerStyle ( style : any ) {
456- return extendObject ( this . trigger . style , style ) ;
457- }
458-
459-
460455 get overlayRect ( ) {
461456 return this . overlayPane . getBoundingClientRect ( ) ;
462457 }
@@ -507,7 +502,8 @@ describe('MatMenu', () => {
507502 it ( 'supports above position fall back' , ( ) => {
508503 // Push trigger to the bottom part of viewport, so it doesn't have space to open
509504 // in its default "below" position below the trigger.
510- subject . updateTriggerStyle ( { position : 'fixed' , bottom : '0' } ) ;
505+ subject . trigger . style . position = 'fixed' ;
506+ subject . trigger . style . bottom = '0' ;
511507 subject . openMenu ( ) ;
512508
513509 // Since the menu is above the trigger, the overlay bottom should be the trigger top.
0 commit comments