forked from hazza/dspace-angular

Also fixed error that showed a blank page instead of a 404 when disabling EULA/Privacy Policy pages
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import {
|
|
ComponentFixture,
|
|
TestBed,
|
|
} from '@angular/core/testing';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { TranslateModule } from '@ngx-translate/core';
|
|
import { of } from 'rxjs';
|
|
|
|
import { NotifyInfoService } from '../../core/coar-notify/notify-info/notify-info.service';
|
|
import { ActivatedRouteStub } from '../../shared/testing/active-router.stub';
|
|
import { NotifyInfoComponent } from './notify-info.component';
|
|
|
|
describe('NotifyInfoComponent', () => {
|
|
let component: NotifyInfoComponent;
|
|
let fixture: ComponentFixture<NotifyInfoComponent>;
|
|
let notifyInfoServiceSpy: any;
|
|
|
|
beforeEach(async () => {
|
|
notifyInfoServiceSpy = jasmine.createSpyObj('NotifyInfoService', ['getCoarLdnLocalInboxUrls']);
|
|
|
|
await TestBed.configureTestingModule({
|
|
imports: [TranslateModule.forRoot(), NotifyInfoComponent],
|
|
providers: [
|
|
{ provide: NotifyInfoService, useValue: notifyInfoServiceSpy },
|
|
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
|
|
],
|
|
})
|
|
.compileComponents();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
fixture = TestBed.createComponent(NotifyInfoComponent);
|
|
component = fixture.componentInstance;
|
|
component.coarRestApiUrl = of([]);
|
|
spyOn(component, 'generateCoarRestApiLinksHTML').and.returnValue(of(''));
|
|
fixture.detectChanges();
|
|
});
|
|
|
|
it('should create', () => {
|
|
expect(component).toBeTruthy();
|
|
});
|
|
});
|