mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
import { 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 '../../core/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 { CreateCommunityPageComponent } from './create-community-page.component';
|
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
|
import { NotificationsServiceStub } from '../../shared/testing/notifications-service-stub';
|
|
|
|
describe('CreateCommunityPageComponent', () => {
|
|
let comp: CreateCommunityPageComponent;
|
|
let fixture: ComponentFixture<CreateCommunityPageComponent>;
|
|
|
|
beforeEach(async(() => {
|
|
TestBed.configureTestingModule({
|
|
imports: [TranslateModule.forRoot(), SharedModule, CommonModule, RouterTestingModule],
|
|
declarations: [CreateCommunityPageComponent],
|
|
providers: [
|
|
{ provide: CommunityDataService, useValue: { findById: () => observableOf({}) } },
|
|
{ provide: RouteService, useValue: { getQueryParameterValue: () => observableOf('1234') } },
|
|
{ provide: Router, useValue: {} },
|
|
{ provide: NotificationsService, useValue: new NotificationsServiceStub() }
|
|
],
|
|
schemas: [NO_ERRORS_SCHEMA]
|
|
}).compileComponents();
|
|
}));
|
|
|
|
beforeEach(() => {
|
|
fixture = TestBed.createComponent(CreateCommunityPageComponent);
|
|
comp = fixture.componentInstance;
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
describe('frontendURL', () => {
|
|
it('should have the right frontendURL set', () => {
|
|
expect((comp as any).frontendURL).toEqual('/communities/');
|
|
})
|
|
});
|
|
});
|