Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should set last property on last child for deprecated dt-breadcrumbs-item', () => {
const fixture = createComponent(TestBreadcrumbsWithDeprecatedItems);
const component = fixture.componentInstance;
const lastValues = component.items.map(
// tslint:disable-next-line:deprecation
(item: DtBreadcrumbsItem) => item._lastItem,
);
expect(lastValues).toEqual([false, false, true]);
});
beforeEach(fakeAsync(() => {
fixture = createComponent(BasicTest);
globalSelectionAreaContainer = getGlobalSelectionAreaHost();
zone.simulateZoneExit();
origin = fixture.componentInstance.origin.nativeElement;
}));
it('should add aria-owns to the label for the associated control', fakeAsync(() => {
const fixture = createComponent(DtInputLabelTestController);
const inputElement: HTMLInputElement = fixture.debugElement.query(
By.css('input'),
).nativeElement;
const labelElement: HTMLInputElement = fixture.debugElement.query(
By.css('label'),
).nativeElement;
expect(labelElement.getAttribute('aria-owns')).toBe(inputElement.id);
}));
it('should disable itself when control is disabled using the property', fakeAsync(() => {
const fixture = createComponent(NgModelSelect);
fixture.componentInstance.isDisabled = true;
fixture.detectChanges();
flush();
const trigger = fixture.debugElement.query(By.css('.dt-select-trigger'))
.nativeElement;
trigger.click();
fixture.detectChanges();
expect(overlayContainerElement.textContent).toEqual('');
expect(fixture.componentInstance.select.panelOpen).toBe(false);
fixture.componentInstance.isDisabled = false;
fixture.detectChanges();
it('has set the default disabled state to false', fakeAsync(() => {
const fixture = createComponent(DtInputWithDisabled);
const inputEl = fixture.debugElement.query(By.css('input')).nativeElement;
expect(inputEl.disabled).toBe(false);
}));
TestBed.configureTestingModule({
imports: [
DtTabsModule,
RouterTestingModule.withRoutes([{ path: '', component: TabComponent }]),
],
declarations: [TabComponent, AppComponent],
providers: [
{
provide: DtTabNavigationAdapter,
useClass: DtTabRouterFragmentAdapter,
deps: [Router, ActivatedRoute, Location, LocationStrategy],
},
],
});
router = TestBed.get(Router);
fixture = createComponent(AppComponent);
});
beforeEach(async(() => {
fixture = createComponent(TestApp);
instanceDebugElement = fixture.debugElement.query(
By.directive(DtExpandableSection),
);
instanceElement = instanceDebugElement.nativeElement;
expandableSectionInstance = instanceDebugElement.injector.get<
DtExpandableSection
>(DtExpandableSection);
}));
beforeEach(async(() => {
fixture = createComponent(TestApp);
testComponent = fixture.componentInstance;
instanceDebugElement = fixture.debugElement.query(
By.directive(DtShowMore),
);
instanceElement = instanceDebugElement.nativeElement;
}));
beforeEach(() => {
fixture = createComponent(SwitchWithFormControl);
switchDebugElement = fixture.debugElement.query(By.directive(DtSwitch));
switchInstance = switchDebugElement.componentInstance;
testComponent = fixture.debugElement.componentInstance;
inputElement = switchDebugElement.nativeElement.querySelector(
'input',
) as HTMLInputElement;
});
beforeEach(() => {
fixture = createComponent(TimestampTestBindingValuesComponent);
timestamp = fixture.componentInstance.timestamp;
});