mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
chore: fix test compilation errors (#8560)
Fixes some more test compilation issues after removing the `extendObject`.
This commit is contained in:
committed by
Jeremy Elbourn
parent
7bcb0d8b94
commit
40d6bcb60a
@@ -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<T extends TestableMenu> {
|
||||
readonly fixture: ComponentFixture<T>;
|
||||
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.
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user