mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fixed test
This commit is contained in:
@@ -89,25 +89,25 @@ describe('SubmissionImportExternalSearchbarComponent test suite', () => {
|
|||||||
compAsAny = null;
|
compAsAny = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Should init component properly (without initExternalSourceData)', fakeAsync(() => {
|
it('Should init component properly (without initExternalSourceData)', () => {
|
||||||
comp.initExternalSourceData = { sourceId: '', query: '' };
|
comp.initExternalSourceData = { sourceId: '', query: '' };
|
||||||
fixture.detectChanges();
|
scheduler.schedule(() => fixture.detectChanges());
|
||||||
tick();
|
scheduler.flush();
|
||||||
|
|
||||||
expect(comp.selectedElement).toEqual(sourceList[0]);
|
expect(comp.selectedElement).toEqual(sourceList[0]);
|
||||||
expect(compAsAny.pageInfo).toEqual(paginatedList.pageInfo);
|
expect(compAsAny.pageInfo).toEqual(paginatedList.pageInfo);
|
||||||
expect(comp.sourceList).toEqual(sourceList);
|
expect(comp.sourceList).toEqual(sourceList);
|
||||||
}));
|
});
|
||||||
|
|
||||||
it('Should init component properly (with initExternalSourceData populated)', fakeAsync(() => {
|
it('Should init component properly (with initExternalSourceData populated)', () => {
|
||||||
comp.initExternalSourceData = { query: 'dummy', sourceId: 'ciencia' };
|
comp.initExternalSourceData = { query: 'dummy', sourceId: 'ciencia' };
|
||||||
fixture.detectChanges();
|
scheduler.schedule(() => fixture.detectChanges());
|
||||||
tick();
|
scheduler.flush();
|
||||||
|
|
||||||
expect(comp.selectedElement).toEqual(sourceList[1]);
|
expect(comp.selectedElement).toEqual(sourceList[1]);
|
||||||
expect(compAsAny.pageInfo).toEqual(paginatedList.pageInfo);
|
expect(compAsAny.pageInfo).toEqual(paginatedList.pageInfo);
|
||||||
expect(comp.sourceList).toEqual(sourceList);
|
expect(comp.sourceList).toEqual(sourceList);
|
||||||
}));
|
});
|
||||||
|
|
||||||
it('Variable \'selectedElement\' should be assigned', () => {
|
it('Variable \'selectedElement\' should be assigned', () => {
|
||||||
const selectedElement = {id: 'orcid', name: 'orcid'};
|
const selectedElement = {id: 'orcid', name: 'orcid'};
|
||||||
|
Reference in New Issue
Block a user