"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/lib/input/input.spec.ts" between
material2-7.3.6.tar.gz and material2-7.3.7.tar.gz

About: material2 offers Material Design components for Angular.

input.spec.ts  (material2-7.3.6):input.spec.ts  (material2-7.3.7)
skipping to change at line 397 skipping to change at line 397
expect(el.nativeElement.textContent).toMatch('Other placeholder'); expect(el.nativeElement.textContent).toMatch('Other placeholder');
expect(el.nativeElement.textContent).not.toMatch(/\*/g); expect(el.nativeElement.textContent).not.toMatch(/\*/g);
})); }));
it('supports placeholder required star', fakeAsync(() => { it('supports placeholder required star', fakeAsync(() => {
let fixture = createComponent(MatInputPlaceholderRequiredTestComponent); let fixture = createComponent(MatInputPlaceholderRequiredTestComponent);
fixture.detectChanges(); fixture.detectChanges();
let el = fixture.debugElement.query(By.css('label')); let el = fixture.debugElement.query(By.css('label'));
expect(el).not.toBeNull(); expect(el).not.toBeNull();
expect(el.nativeElement.textContent).toMatch(/hello\s+\*/g); expect(el.nativeElement.textContent).toMatch(/hello +\*/g);
})); }));
it('should hide the required star if input is disabled', () => { it('should hide the required star if input is disabled', () => {
const fixture = createComponent(MatInputPlaceholderRequiredTestComponent); const fixture = createComponent(MatInputPlaceholderRequiredTestComponent);
fixture.componentInstance.disabled = true; fixture.componentInstance.disabled = true;
fixture.detectChanges(); fixture.detectChanges();
const el = fixture.debugElement.query(By.css('label')); const el = fixture.debugElement.query(By.css('label'));
expect(el).not.toBeNull(); expect(el).not.toBeNull();
expect(el.nativeElement.textContent!.trim()).toMatch(/^hello$/); expect(el.nativeElement.textContent!.trim()).toMatch(/^hello$/);
expect(el.nativeElement.textContent).not.toMatch(/\*/g);
}); });
it('should hide the required star from screen readers', fakeAsync(() => { it('should hide the required star from screen readers', fakeAsync(() => {
let fixture = createComponent(MatInputPlaceholderRequiredTestComponent); let fixture = createComponent(MatInputPlaceholderRequiredTestComponent);
fixture.detectChanges(); fixture.detectChanges();
let el = fixture.debugElement.query(By.css('.mat-form-field-required-marker' )).nativeElement; let el = fixture.debugElement.query(By.css('.mat-form-field-required-marker' )).nativeElement;
expect(el.getAttribute('aria-hidden')).toBe('true'); expect(el.getAttribute('aria-hidden')).toBe('true');
})); }));
it('hide placeholder required star when set to hide the required marker', fake Async(() => { it('hide placeholder required star when set to hide the required marker', fake Async(() => {
let fixture = createComponent(MatInputPlaceholderRequiredTestComponent); let fixture = createComponent(MatInputPlaceholderRequiredTestComponent);
fixture.detectChanges(); fixture.detectChanges();
let el = fixture.debugElement.query(By.css('label')); let el = fixture.debugElement.query(By.css('label'));
expect(el).not.toBeNull(); expect(el).not.toBeNull();
expect(el.nativeElement.textContent).toMatch(/hello\s+\*/g); expect(el.nativeElement.textContent).toMatch(/hello +\*/g);
fixture.componentInstance.hideRequiredMarker = true; fixture.componentInstance.hideRequiredMarker = true;
fixture.detectChanges(); fixture.detectChanges();
expect(el.nativeElement.textContent).toMatch(/hello/g); expect(el.nativeElement.textContent).toMatch(/hello/g);
expect(el.nativeElement.textContent).not.toMatch(/\*/g);
})); }));
it('supports the disabled attribute as binding', fakeAsync(() => { it('supports the disabled attribute as binding', fakeAsync(() => {
const fixture = createComponent(MatInputWithDisabled); const fixture = createComponent(MatInputWithDisabled);
fixture.detectChanges(); fixture.detectChanges();
const formFieldEl = const formFieldEl =
fixture.debugElement.query(By.css('.mat-form-field')).nativeElement; fixture.debugElement.query(By.css('.mat-form-field')).nativeElement;
const inputEl = fixture.debugElement.query(By.css('input')).nativeElement; const inputEl = fixture.debugElement.query(By.css('input')).nativeElement;
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)