mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3855] Add minimum length to library title (#4139)
* [ADF-3855] Add minimum length to library title * update name test
This commit is contained in:
committed by
Eugenio Romano
parent
aa6ba28427
commit
46150a65f2
@@ -259,4 +259,20 @@ describe('LibraryDialogComponent', () => {
|
||||
|
||||
expect(component.form.controls.id.value).toBe('library-title');
|
||||
}));
|
||||
|
||||
it('should invalidate library title if is too short', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
component.form.controls.title.setValue('l');
|
||||
tick(500);
|
||||
flush();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.form.controls.title.errors['minlength']).toBeTruthy();
|
||||
expect(component.form.valid).toBe(false);
|
||||
}));
|
||||
});
|
||||
|
Reference in New Issue
Block a user