mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
import { TranslateModule } from '@ngx-translate/core';
|
|
import { CommonModule } from '@angular/common';
|
|
import { RouterTestingModule } from '@angular/router/testing';
|
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
|
import { RouteService } from '../../shared/services/route.service';
|
|
import { SharedModule } from '../../shared/shared.module';
|
|
import { CollectionDataService } from '../../core/data/collection-data.service';
|
|
import { of as observableOf } from 'rxjs';
|
|
import { CommunityDataService } from '../../core/data/community-data.service';
|
|
import { CreateCollectionPageComponent } from './create-collection-page.component';
|
|
|
|
describe('CreateCollectionPageComponent', () => {
|
|
let comp: CreateCollectionPageComponent;
|
|
let fixture: ComponentFixture<CreateCollectionPageComponent>;
|
|
|
|
beforeEach(async(() => {
|
|
TestBed.configureTestingModule({
|
|
imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule],
|
|
declarations: [CreateCollectionPageComponent],
|
|
providers: [
|
|
{ provide: CollectionDataService, useValue: {} },
|
|
{
|
|
provide: CommunityDataService,
|
|
useValue: { findById: () => observableOf({ payload: { name: 'test' } }) }
|
|
},
|
|
{ provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } },
|
|
{ provide: Router, useValue: {} },
|
|
],
|
|
schemas: [NO_ERRORS_SCHEMA]
|
|
}).compileComponents();
|
|
}));
|
|
|
|
beforeEach(() => {
|
|
fixture = TestBed.createComponent(CreateCollectionPageComponent);
|
|
comp = fixture.componentInstance;
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
describe('frontendURL', () => {
|
|
it('should have the right frontendURL set', () => {
|
|
expect((comp as any).frontendURL).toEqual('/collections/');
|
|
})
|
|
});
|
|
});
|