Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/lib/menu/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand All @@ -452,11 +452,6 @@ describe('MatMenu', () => {
this.fixture.detectChanges();
}

updateTriggerStyle(style: any) {
return extendObject(this.trigger.style, style);
}


get overlayRect() {
return this.overlayPane.getBoundingClientRect();
}
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions src/lib/select/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
} from '@angular/forms';
import {
ErrorStateMatcher,
extendObject,
FloatPlaceholderType,
MAT_PLACEHOLDER_GLOBAL_OPTIONS,
MatOption,
Expand Down Expand Up @@ -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};
}
}

Expand Down