"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/material/input/input.spec.ts" between
components-12.0.3.tar.gz and components-12.0.4.tar.gz

About: components offers Component infrastructure and Material Design components for Angular.

input.spec.ts  (components-12.0.3):input.spec.ts  (components-12.0.4)
skipping to change at line 1222 skipping to change at line 1222
fixture.detectChanges(); fixture.detectChanges();
let errorIds = fixture.debugElement.queryAll(By.css('.mat-error')) let errorIds = fixture.debugElement.queryAll(By.css('.mat-error'))
.map(el => el.nativeElement.getAttribute('id')).join(' '); .map(el => el.nativeElement.getAttribute('id')).join(' ');
describedBy = inputEl.getAttribute('aria-describedby'); describedBy = inputEl.getAttribute('aria-describedby');
expect(errorIds).toBeTruthy('errors should be shown'); expect(errorIds).toBeTruthy('errors should be shown');
expect(describedBy).toBe(errorIds); expect(describedBy).toBe(errorIds);
})); }));
it('should not set `aria-invalid` to true if the input is empty', fakeAsync( () => { it('should set `aria-invalid` to true if the input is empty', fakeAsync(() = > {
// Submit the form since it's the one that triggers the default error stat e matcher. // Submit the form since it's the one that triggers the default error stat e matcher.
dispatchFakeEvent(fixture.nativeElement.querySelector('form'), 'submit'); dispatchFakeEvent(fixture.nativeElement.querySelector('form'), 'submit');
fixture.detectChanges(); fixture.detectChanges();
flush(); flush();
expect(testComponent.formControl.invalid).toBe(true, 'Expected form contro l to be invalid'); expect(testComponent.formControl.invalid).toBe(true, 'Expected form contro l to be invalid');
expect(inputEl.value).toBeFalsy(); expect(inputEl.value).toBeFalsy();
expect(inputEl.getAttribute('aria-invalid')) expect(inputEl.getAttribute('aria-invalid'))
.toBe('false', 'Expected aria-invalid to be set to "false".'); .toBe('true', 'Expected aria-invalid to be set to "true".');
inputEl.value = 'not valid'; inputEl.value = 'not valid';
fixture.detectChanges(); fixture.detectChanges();
expect(testComponent.formControl.invalid).toBe(true, 'Expected form contro l to be invalid'); expect(testComponent.formControl.invalid).toBe(true, 'Expected form contro l to be invalid');
expect(inputEl.getAttribute('aria-invalid')) expect(inputEl.getAttribute('aria-invalid'))
.toBe('true', 'Expected aria-invalid to be set to "true".'); .toBe('true', 'Expected aria-invalid to be set to "true".');
})); }));
}); });
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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