type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
fixture.componentInstance.theme = 'error';
fixture.componentInstance.select.open();
fixture.detectChanges();
flush();
const panel = overlayContainerElement.querySelector('.mc-select__panel') as HTMLElement;
expect(panel.classList).toConta... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([InvalidSelectInForm])));
it('should not throw SelectionModel errors in addition to ngModel errors', fakeAsync(() => {
const fixture = TestBed.createComponent(InvalidSelectInForm);
// The first change detecti... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([InvalidSelectInForm]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(InvalidSelectInForm);
// The first change detection run will throw the "ngModel is missing a name" error.
expect(() => fixture.detectChanges()).toThrowError(/the name attribute must be set/g);
// The second run shouldn't ... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([NgModelCompareWithSelect])));
let fixture: ComponentFixture<NgModelCompareWithSelect>;
let instance: NgModelCompareWithSelect;
beforeEach(fakeAsync(() => {
fixture = TestBed.createComponent(NgModelCompar... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([NgModelCompareWithSelect]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NgModelCompareWithSelect);
instance = fixture.componentInstance;
fixture.detectChanges();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should have a selection', fakeAsync(() => {
const selectedOption = instance.select.selected as McOption;
expect(selectedOption.value.value).toEqual('pizza-1');
}));
it('should update when making a new selection', fakeAsync(() => {
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const selectedOption = instance.select.selected as McOption;
expect(selectedOption.value.value).toEqual('pizza-1');
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
instance.options.last.selectViaInteraction();
fixture.detectChanges();
flush();
const selectedOption = instance.select.selected as McOption;
expect(instance.selectedFood.value).toEqual('tacos-2');
expect(selectedOp... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(fakeAsync(() => {
spyOn(instance, 'compareByReference').and.callThrough();
instance.useCompareByReference();
fixture.detectChanges();
flush();
}));
it('should use the comparator', fakeAsync(() => {
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
spyOn(instance, 'compareByReference').and.callThrough();
instance.useCompareByReference();
fixture.detectChanges();
flush();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(instance.compareByReference).toHaveBeenCalled();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(instance.selectedFood.value).toBe('pizza-1');
expect(instance.select.selected).toBeUndefined();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
instance.options.first.selectViaInteraction();
fixture.detectChanges();
flush();
expect(instance.selectedFood.value).toEqual('steak-0');
expect(instance.select.selected).toBeUndefined();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
instance.useNullComparator();
expect(() => {
fixture.detectChanges();
}).toThrowError(wrappedErrorMessage(getMcSelectNonFunctionValueError()));
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([SelectEarlyAccessSibling])));
it('should not throw when trying to access the selected value on init', fakeAsync(() => {
expect(() => {
TestBed.createComponent(SelectEarlyAccessSibling).detectChanges();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([SelectEarlyAccessSibling]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(() => {
TestBed.createComponent(SelectEarlyAccessSibling).detectChanges();
}).not.toThrow();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.createComponent(SelectEarlyAccessSibling).detectChanges();
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([SelectInsideFormGroup])));
let fixture: ComponentFixture<SelectInsideFormGroup>;
let testComponent: SelectInsideFormGroup;
let select: HTMLElement;
beforeEach(fakeAsync(() => {
fixture = TestBed.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([SelectInsideFormGroup]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(SelectInsideFormGroup);
fixture.detectChanges();
testComponent = fixture.componentInstance;
select = fixture.debugElement.query(By.css('mc-select')).nativeElement;
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(testComponent.formGroup.untouched).toBe(true, 'Expected the form to be untouched.');
expect(testComponent.formControl.invalid).toBe(false, 'Expected form control to be invalid.');
expect(select.classList)
.not.toContain('mc-invalid', 'Expected select n... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(select.classList)
.not.toContain('mc-invalid', 'Expected select not to appear invalid.');
testComponent.formControl.markAsTouched();
fixture.detectChanges();
expect(select.classList)
.not.toContain('mc-invalid', 'Expected ... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.formControl.markAsTouched();
fixture.detectChanges();
expect(select.classList)
.not.toContain('mc-invalid', 'Expected select to appear invalid.');
testComponent.formControl.setValue('pizza-1');
fixture.detectChanges();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
expect(select.classList)
.not.toContain('mc-invalid', 'Expected select not to appear invalid.');
dispatchFakeEvent(fixture.debugElement.query(By.css('form')).nativeElement, 'submit');
fixture.detectChanges();
expect(select.classList)
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const debugEl = fixture.debugElement.nativeElement;
expect(debugEl.querySelectorAll('mc-error').length).toBe(0, 'Expected no error messages');
dispatchFakeEvent(fixture.debugElement.query(By.css('form')).nativeElement, 'submit');
fixture.detectChanges();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const errorStateMatcher: ErrorStateMatcher = {
isErrorState: jasmine.createSpy('error state matcher').and.returnValue(true)
};
fixture.destroy();
TestBed.resetTestingModule().configureTestingModule({
imports: [McSelectModule, Rea... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([CustomErrorBehaviorSelect])));
it('should be able to override the error matching behavior via an @Input', fakeAsync(() => {
const fixture = TestBed.createComponent(CustomErrorBehaviorSelect);
const component ... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([CustomErrorBehaviorSelect]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(CustomErrorBehaviorSelect);
const component = fixture.componentInstance;
const matcher = jasmine.createSpy('error state matcher').and.returnValue(true);
fixture.detectChanges();
expect(component.control.invali... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([
SingleSelectWithPreselectedArrayValues
])));
xit('should be able to preselect an array value in single-selection mode', fakeAsync(() => {
const fixture = TestBed.createComponent(SingleSelectWithPrese... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
SingleSelectWithPreselectedArrayValues
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(SingleSelectWithPreselectedArrayValues);
fixture.detectChanges();
flush();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
expect(trigger.textContent).toContain('Pizza'... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([
CompWithCustomSelect,
CustomSelectAccessor
])));
it('should support use inside a custom value accessor', fakeAsync(() => {
const fixture = TestBed.createComponent(CompWithCustomSelect);
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
CompWithCustomSelect,
CustomSelectAccessor
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(CompWithCustomSelect);
spyOn(fixture.componentInstance.customAccessor, 'writeValue');
fixture.detectChanges();
expect(fixture.componentInstance.customAccessor.select.ngControl)
.toBeFalsy('Expected mc-selec... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([FalsyValueSelect])));
it('should be able to programmatically select a falsy option', fakeAsync(() => {
const fixture = TestBed.createComponent(FalsyValueSelect);
fixture.detectChanges();
fixture.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([FalsyValueSelect]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(FalsyValueSelect);
fixture.detectChanges();
fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement.click();
fixture.componentInstance.control.setValue(0);
fixture.detectChanges();
f... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([
BasicSelectOnPush,
BasicSelectOnPushPreselected
])));
xit('should set the trigger text based on the value when initialized', fakeAsync(() => {
const fixture = TestBed.createComponent(Basi... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
BasicSelectOnPush,
BasicSelectOnPushPreselected
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectOnPushPreselected);
fixture.detectChanges();
flush();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
fixture.detectChanges();
expect(trigger.t... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectOnPush);
fixture.detectChanges();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
fixture.componentInstance.control.setValue('pizza-1');
fixture.detectChanges... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([SelectWithCustomTrigger])));
xit('should allow the user to customize the label', fakeAsync(() => {
const fixture = TestBed.createComponent(SelectWithCustomTrigger);
fixture.detectChanges();
fixtu... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([SelectWithCustomTrigger]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(SelectWithCustomTrigger);
fixture.detectChanges();
fixture.componentInstance.control.setValue('pizza-1');
fixture.detectChanges();
const label = fixture.debugElement.query(By.css('.mc-select__matcher')).native... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([ResetValuesSelect])));
let fixture: ComponentFixture<ResetValuesSelect>;
let trigger: HTMLElement;
let formField: HTMLElement;
let options: NodeListOf<HTMLElement>;
beforeEach(fakeAsync(() => {
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([ResetValuesSelect]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(ResetValuesSelect);
fixture.detectChanges();
trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
formField = fixture.debugElement.query(By.css('.mc-form-field')).nativeElement;
trigger.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
options[4].click();
fixture.detectChanges();
flush();
expect(fixture.componentInstance.control.value).toBeUndefined();
expect(fixture.componentInstance.select.selected).toBeFalsy();
expect(formField.classList).not.toContain('mc-form-field... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
options[5].click();
fixture.detectChanges();
flush();
expect(fixture.componentInstance.control.value).toBeNull();
expect(fixture.componentInstance.select.selected).toBeFalsy();
expect(formField.classList).not.toContain('mc-form-field-shou... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
options[6].click();
fixture.detectChanges();
flush();
expect(fixture.componentInstance.control.value).toBeUndefined();
expect(fixture.componentInstance.select.selected).toBeFalsy();
expect(formField.classList).not.toContain('mc-form-field... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
options[5].click();
fixture.detectChanges();
flush();
fixture.componentInstance.select.open();
fixture.detectChanges();
flush();
expect(options[5].classList).not.toContain('mc-selected');
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
options[3].click();
fixture.detectChanges();
flush();
expect(fixture.componentInstance.control.value).toBe(false);
expect(fixture.componentInstance.select.selected).toBeTruthy();
expect(trigger.textContent).toContain('Falsy');
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.componentInstance.control.reset();
fixture.detectChanges();
expect(fixture.componentInstance.control.value).toBeNull();
expect(fixture.componentInstance.select.selected).toBeFalsy();
expect(trigger.textContent).not.toConta... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([
BasicSelectWithoutForms,
BasicSelectWithoutFormsPreselected,
BasicSelectWithoutFormsMultiple
])));
it('should set the value when options are clicked', fakeAsync(() => {
const ... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
BasicSelectWithoutForms,
BasicSelectWithoutFormsPreselected,
BasicSelectWithoutFormsMultiple
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
fixture.detectChanges();
expect(fixture.componentInstance.selectedFood).toBeFalsy();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
trigger.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
fixture.detectChanges();
fixture.componentInstance.selectedFood = 'sandwich-2';
fixture.detectChanges();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nati... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
fixture.detectChanges();
expect(fixture.componentInstance.selectedFood).toBeFalsy();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
trigger.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutFormsPreselected);
fixture.detectChanges();
flush();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
fixture.detectChanges();
expect(trigg... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutFormsMultiple);
fixture.detectChanges();
expect(fixture.componentInstance.selectedFoods).toBeFalsy();
const trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
fixture.detectChanges();
fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement.click();
fixture.detectChanges();
flush();
(overlayContainerElement.queryS... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
const select = fixture.debugElement.nativeElement.querySelector('mc-select');
fixture.detectChanges();
fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement.click();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const fixture = TestBed.createComponent(BasicSelectWithoutForms);
const instance = fixture.componentInstance;
const spy = jasmine.createSpy('change spy');
fixture.detectChanges();
instance.select.selectionChange.subscribe(() => spy(instance.selectedF... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => spy(instance.selectedFood) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(waitForAsync(() => configureMcSelectTestingModule([
SelectWithoutOptionCentering
])));
let fixture: ComponentFixture<SelectWithoutOptionCentering>;
let trigger: HTMLElement;
beforeEach(fakeAsync(() => {
fixture = TestBed.createCompone... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
SelectWithoutOptionCentering
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(SelectWithoutOptionCentering);
fixture.detectChanges();
trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
trigger.click();
fixture.detectChanges();
flush();
const scrollContainer = document.querySelector('.cdk-overlay-pane .mc-select__panel')!;
// The panel should be scrolled to 0 because centering the option disabled.
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => configureMcSelectTestingModule([
BasicSelect,
MultiSelect,
SelectWithGroups
]) | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(BasicSelect);
fixture.detectChanges();
trigger = fixture.debugElement.query(By.css('.mc-select__trigger')).nativeElement;
formField = fixture.debugElement.query(By.css('mc-form-field')).nativeElement;
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(fakeAsync(() => {
// these styles are necessary because we are first testing the overlay's position
// if there is room for it to open to its full extent in either direction.
formField.style.position = 'fixed';
formField.sty... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// these styles are necessary because we are first testing the overlay's position
// if there is room for it to open to its full extent in either direction.
formField.style.position = 'fixed';
formField.style.top = '285px';
formFie... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// We shouldn't push it too far down for this one, because the default may
// end up being too much when running the tests on mobile browsers.
formField.style.top = '100px';
trigger.click();
fixture.detectChange... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Select the second option, because it can't be scrolled any further downward
fixture.componentInstance.control.setValue('pizza-1');
fixture.detectChanges();
trigger.click();
fixture.detectChanges();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Select the fifth option, which has enough space to scroll to the center
fixture.componentInstance.control.setValue('chips-4');
fixture.detectChanges();
flush();
trigger.click();
fixture.detectChanges();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Select the last option in the list
fixture.componentInstance.control.setValue('sushi-7');
fixture.detectChanges();
flush();
trigger.click();
fixture.detectChanges();
flush();
con... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Test is off-by-one on edge for some reason, but verified that it looks correct through
// manual testing.
if (platform.EDGE) { return; }
fixture.destroy();
const groupFixture = TestBed.createComponent(SelectWithGroups);
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(fakeAsync(() => {
formField.style.position = 'fixed';
formField.style.left = '20px';
}));
xit('should adjust position of centered option if there is little space above',
fakeAsync(() => {
const s... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
formField.style.position = 'fixed';
formField.style.left = '20px';
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const selectMenuHeight = 256;
const selectMenuViewportPadding = 8;
const selectItemHeight = 48;
const selectedIndex = 4;
const fontSize = 16;
const lineHeightEm = 1.125;
c... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const selectMenuHeight = 256;
const selectMenuViewportPadding = 8;
const selectItemHeight = 48;
const selectedIndex = 4;
const fontSize = 16;
const lineHeightEm = 1.125;
c... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Push the select to a position with not enough space on the bottom to open
formField.style.bottom = '56px';
fixture.detectChanges();
// Select an option that cannot be scrolled any farther upward
fixture.comp... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Push the select to a position with not enough space on the top to open
formField.style.top = '85px';
// Select an option that cannot be scrolled any farther downward
fixture.componentInstance.control.setValue('sushi-7');
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
const startingWindowHeight = window.innerHeight;
// Need to set the scrollTop two different ways to support
// both Chrome and Firefox.
function setScrollTop(num: number) {
document.body.scrollTop = num;
document.documentElement.s... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Make the div above the select very tall, so the page will scroll
fixture.componentInstance.heightAbove = 2000;
fixture.detectChanges();
setScrollTop(0);
// Give the select enough horizontal space to open
formFie... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Give the select insufficient space to open below the trigger
fixture.componentInstance.heightAbove = 0;
fixture.componentInstance.heightBelow = 100;
trigger.style.marginTop = '2000px';
fixture.detectChanges();
/... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
// Give plenty of space for the select to open below the trigger
fixture.componentInstance.heightBelow = 650;
fixture.detectChanges();
// Select an option too low in the list to fit in limited space above
fixture.componentInstance... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(fakeAsync(() => {
formField.style.position = 'fixed';
formField.style.left = '30px';
}));
xit('should align the trigger and the selected option on the x-axis in ltr', fakeAsync(() => {
trigger.click();
... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
formField.style.position = 'fixed';
formField.style.left = '30px';
} | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
trigger.click();
fixture.detectChanges();
flush();
const triggerLeft: number = trigger.getBoundingClientRect().left;
const firstOptionLeft = document.querySelector('.cdk-overlay-pane mc-option')!
.getBoundingCl... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
dir.value = 'rtl';
fixture.detectChanges();
trigger.click();
fixture.detectChanges();
flush();
const triggerRight: number = trigger.getBoundingClientRect().right;
const firstOptionRight = document.... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
let multiFixture: ComponentFixture<MultiSelect>;
beforeEach(fakeAsync(() => {
multiFixture = TestBed.createComponent(MultiSelect);
multiFixture.detectChanges();
formField = multiFixture.debugElement.query(By.css('.mc-form-field')).nativeE... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
multiFixture = TestBed.createComponent(MultiSelect);
multiFixture.detectChanges();
formField = multiFixture.debugElement.query(By.css('.mc-form-field')).nativeElement;
trigger = multiFixture.debugElement.query(By.css('.mc-select__trigger')).native... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
trigger.click();
multiFixture.detectChanges();
flush();
const triggerLeft: number = trigger.getBoundingClientRect().left;
const firstOptionLeft = document.querySelector('.cdk-overlay-pane mc-option')!
.getBound... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
ArrowFunction |
() => {
dir.value = 'rtl';
trigger.click();
multiFixture.detectChanges();
flush();
const triggerRight: number = trigger.getBoundingClientRect().right;
const firstOptionRight = document.querySelector('.cdk-overlay-pane mc-o... | anywie/mosaic | packages/mosaic/select/select.component.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.