mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
[DURACOM-145] Handled collection step
on a submission form
This commit is contained in:
@@ -25,6 +25,7 @@ import { createTestComponent } from '../../shared/testing/utils.test';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
import { TestScheduler } from 'rxjs/testing';
|
||||
import { SectionsService } from '../sections/sections.service';
|
||||
import { VisibilityType } from '../sections/visibility-type';
|
||||
|
||||
describe('SubmissionFormComponent Component', () => {
|
||||
|
||||
@@ -156,6 +157,32 @@ describe('SubmissionFormComponent Component', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
it('should return the visibility object of the collection section', () => {
|
||||
comp.submissionDefinition = submissionDefinition;
|
||||
fixture.detectChanges();
|
||||
const result = compAsAny.getCollectionVisibility();
|
||||
expect(result).toEqual({
|
||||
main: VisibilityType.HIDDEN,
|
||||
other: VisibilityType.HIDDEN,
|
||||
});
|
||||
});
|
||||
|
||||
it('should return true if collection section visibility is hidden', () => {
|
||||
comp.submissionDefinition = submissionDefinition;
|
||||
fixture.detectChanges();
|
||||
expect(comp.isSectionHidden).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for isSectionReadonly when collection section visibility is not READONLY', () => {
|
||||
const visibility = {
|
||||
main: VisibilityType.READONLY,
|
||||
other: VisibilityType.READONLY,
|
||||
};
|
||||
comp.submissionDefinition = Object.assign({}, submissionDefinition, { visibility: visibility });
|
||||
fixture.detectChanges();
|
||||
expect(comp.isSectionReadonly).toBe(false);
|
||||
});
|
||||
|
||||
it('should update properly on collection change', (done) => {
|
||||
comp.collectionId = collectionId;
|
||||
comp.submissionId = submissionId;
|
||||
|
Reference in New Issue
Block a user