[CST-3091] fix close dialog and test

This commit is contained in:
Danilo Di Nuzzo
2020-06-26 16:15:16 +02:00
parent 8df505b4a0
commit 806843640f
3 changed files with 12 additions and 1 deletions

View File

@@ -156,4 +156,9 @@ describe('CollectionSelectorComponent', () => {
expect(component.selectObject).toHaveBeenCalled();
});
}));
it('should close the dialog', () => {
component.close();
expect((component as any).activeModal.close).toHaveBeenCalled();
});
});

View File

@@ -20,4 +20,10 @@ export class CollectionSelectorComponent {
this.activeModal.close(dso);
}
/**
* Close the modal
*/
close() {
this.activeModal.close();
}
}

View File

@@ -24,7 +24,7 @@ import { By } from '@angular/platform-browser';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { UploaderComponent } from 'src/app/shared/uploader/uploader.component';
fdescribe('MyDSpaceNewSubmissionComponent test', () => {
describe('MyDSpaceNewSubmissionComponent test', () => {
const translateService: TranslateService = jasmine.createSpyObj('translateService', {
get: (key: string): any => { observableOf(key) },