1
0
Files
yel-dspace-angular/src/app/info/notify-info/notify-info.component.spec.ts
Alexandre Vryghem e10630f131 Added functionality to disable COAR notify support link in footer
Also fixed error that showed a blank page instead of a 404 when disabling EULA/Privacy Policy pages
2024-04-12 01:38:34 +02:00

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();
});
});