Skip to content

Commit 8a1f439

Browse files
committed
chore: fix test compilation errors
Fixes some more test compilation issues after removing the `extendObject`.
1 parent 05084e9 commit 8a1f439

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/lib/menu/menu.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
MatMenuItem,
2727
} from './index';
2828
import {MENU_PANEL_TOP_PADDING} from './menu-trigger';
29-
import {extendObject, MatRipple} from '@angular/material/core';
29+
import {MatRipple} from '@angular/material/core';
3030
import {
3131
dispatchKeyboardEvent,
3232
dispatchMouseEvent,
@@ -442,7 +442,7 @@ describe('MatMenu', () => {
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
}
@@ -453,7 +453,7 @@ describe('MatMenu', () => {
453453
}
454454

455455
updateTriggerStyle(style: any) {
456-
return extendObject(this.trigger.style, style);
456+
return {...this.trigger.style, ...style};
457457
}
458458

459459

src/lib/select/select.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
} from '@angular/forms';
4141
import {
4242
ErrorStateMatcher,
43-
extendObject,
4443
FloatPlaceholderType,
4544
MAT_PLACEHOLDER_GLOBAL_OPTIONS,
4645
MatOption,
@@ -3984,7 +3983,7 @@ class NgModelCompareWithSelect {
39843983
compareByReference(f1: any, f2: any) { return f1 === f2; }
39853984

39863985
setFoodByCopy(newValue: {value: string, viewValue: string}) {
3987-
this.selectedFood = extendObject({}, newValue);
3986+
this.selectedFood = {...{}, ...newValue};
39883987
}
39893988
}
39903989

0 commit comments

Comments
 (0)