diff --git a/src/lib/menu/menu.spec.ts b/src/lib/menu/menu.spec.ts index 76827f68f261..96ceede4320a 100644 --- a/src/lib/menu/menu.spec.ts +++ b/src/lib/menu/menu.spec.ts @@ -26,7 +26,7 @@ import { MatMenuItem, } from './index'; import {MENU_PANEL_TOP_PADDING} from './menu-trigger'; -import {extendObject, MatRipple} from '@angular/material/core'; +import {MatRipple} from '@angular/material/core'; import { dispatchKeyboardEvent, dispatchMouseEvent, @@ -438,11 +438,11 @@ describe('MatMenu', () => { */ class OverlapSubject { readonly fixture: ComponentFixture; - readonly trigger: any; + readonly trigger: HTMLElement; constructor(ctor: {new(): T; }, inputs: {[key: string]: any} = {}) { this.fixture = TestBed.createComponent(ctor); - extendObject(this.fixture.componentInstance, inputs); + Object.keys(inputs).forEach(key => this.fixture.componentInstance[key] = inputs[key]); this.fixture.detectChanges(); this.trigger = this.fixture.componentInstance.triggerEl.nativeElement; } @@ -452,11 +452,6 @@ describe('MatMenu', () => { this.fixture.detectChanges(); } - updateTriggerStyle(style: any) { - return extendObject(this.trigger.style, style); - } - - get overlayRect() { return this.overlayPane.getBoundingClientRect(); } @@ -507,7 +502,8 @@ describe('MatMenu', () => { it('supports above position fall back', () => { // Push trigger to the bottom part of viewport, so it doesn't have space to open // in its default "below" position below the trigger. - subject.updateTriggerStyle({position: 'fixed', bottom: '0'}); + subject.trigger.style.position = 'fixed'; + subject.trigger.style.bottom = '0'; subject.openMenu(); // Since the menu is above the trigger, the overlay bottom should be the trigger top. diff --git a/src/lib/select/select.spec.ts b/src/lib/select/select.spec.ts index 985a25735d48..f4b0d8c79114 100644 --- a/src/lib/select/select.spec.ts +++ b/src/lib/select/select.spec.ts @@ -40,7 +40,6 @@ import { } from '@angular/forms'; import { ErrorStateMatcher, - extendObject, FloatPlaceholderType, MAT_PLACEHOLDER_GLOBAL_OPTIONS, MatOption, @@ -3984,7 +3983,7 @@ class NgModelCompareWithSelect { compareByReference(f1: any, f2: any) { return f1 === f2; } setFoodByCopy(newValue: {value: string, viewValue: string}) { - this.selectedFood = extendObject({}, newValue); + this.selectedFood = {...{}, ...newValue}; } }