clean unit test (#4890)

* promote use setupTestbed

* fix comment using right spy and remove deprecated moment method usage

* restore md icon file

* remove error translation log

* restore extension test
This commit is contained in:
Eugenio Romano
2019-07-02 16:00:58 +01:00
committed by GitHub
parent 87b80235a7
commit 0d6140be77
17 changed files with 208 additions and 226 deletions

View File

@@ -117,10 +117,10 @@ describe('CommentListComponent', () => {
beforeEach(async(() => {
ecmUserService = TestBed.get(EcmUserService);
spyOn(ecmUserService, 'getUserProfileImage').and.returnValue('content-user-image');
spyOn(ecmUserService, 'getUserProfileImage').and.returnValue('alfresco-logo.svg');
peopleProcessService = TestBed.get(PeopleProcessService);
spyOn(peopleProcessService, 'getUserImage').and.returnValue('process-user-image');
spyOn(peopleProcessService, 'getUserImage').and.returnValue('alfresco-logo.svg');
fixture = TestBed.createComponent(CommentListComponent);
commentList = fixture.componentInstance;
@@ -259,7 +259,7 @@ describe('CommentListComponent', () => {
fixture.whenStable().then(() => {
const elements = fixture.nativeElement.querySelectorAll('.adf-people-img');
expect(elements.length).toBe(1);
expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('content-user-image');
expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('alfresco-logo.svg');
});
}));
@@ -270,7 +270,7 @@ describe('CommentListComponent', () => {
fixture.whenStable().then(() => {
const elements = fixture.nativeElement.querySelectorAll('.adf-people-img');
expect(elements.length).toBe(1);
expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('process-user-image');
expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('alfresco-logo.svg');
});
}));