mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[CST-3105] tests
This commit is contained in:
@@ -18,8 +18,12 @@ import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/jso
|
|||||||
import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner';
|
import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner';
|
||||||
import { createTestComponent } from '../../../shared/testing/utils.test';
|
import { createTestComponent } from '../../../shared/testing/utils.test';
|
||||||
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
import { CollectionDataService } from '../../../core/data/collection-data.service';
|
||||||
|
import { hot } from 'jasmine-marbles';
|
||||||
|
import { of } from 'rxjs';
|
||||||
|
import { SectionsService } from '../../sections/sections.service';
|
||||||
|
import { componentFactoryName } from '@angular/compiler';
|
||||||
|
|
||||||
describe('SubmissionFormCollectionComponent Component', () => {
|
fdescribe('SubmissionFormCollectionComponent Component', () => {
|
||||||
|
|
||||||
let comp: SubmissionFormCollectionComponent;
|
let comp: SubmissionFormCollectionComponent;
|
||||||
let compAsAny: any;
|
let compAsAny: any;
|
||||||
@@ -48,6 +52,10 @@ describe('SubmissionFormCollectionComponent Component', () => {
|
|||||||
replace: jasmine.createSpy('replace')
|
replace: jasmine.createSpy('replace')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const sectionsService: any = jasmine.createSpyObj('sectionsService', {
|
||||||
|
isSectionAvailable: of(true)
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -67,6 +75,7 @@ describe('SubmissionFormCollectionComponent Component', () => {
|
|||||||
{ provide: CommunityDataService, useValue: communityDataService },
|
{ provide: CommunityDataService, useValue: communityDataService },
|
||||||
{ provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder },
|
{ provide: JsonPatchOperationsBuilder, useValue: jsonPatchOpBuilder },
|
||||||
{ provide: Store, useValue: store },
|
{ provide: Store, useValue: store },
|
||||||
|
{ provide: SectionsService, useValue: sectionsService },
|
||||||
ChangeDetectorRef,
|
ChangeDetectorRef,
|
||||||
SubmissionFormCollectionComponent
|
SubmissionFormCollectionComponent
|
||||||
],
|
],
|
||||||
@@ -160,6 +169,17 @@ describe('SubmissionFormCollectionComponent Component', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('the dropdown menu should be enable', () => {
|
||||||
|
const dropDown = fixture.debugElement.query(By.css('#collectionControlsDropdownMenu'));
|
||||||
|
expect(dropDown).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('the dropdown menu should be disabled', () => {
|
||||||
|
comp.available$ = of(false);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const dropDown = fixture.debugElement.query(By.css('#collectionControlsDropdownMenu'));
|
||||||
|
expect(dropDown).toBeFalsy();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user