mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 21:43:04 +00:00
fixed tests after angular 10 upgrade
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { BrowserModule, By } from '@angular/platform-browser';
|
||||
import { CommonModule } from '@angular/common';
|
||||
@@ -118,6 +118,8 @@ describe('ResourcePolicyFormComponent test suite', () => {
|
||||
let de;
|
||||
let scheduler: TestScheduler;
|
||||
|
||||
const formService: any = getMockFormService();
|
||||
|
||||
const resourcePolicy: any = {
|
||||
id: '1',
|
||||
name: null,
|
||||
@@ -153,7 +155,7 @@ describe('ResourcePolicyFormComponent test suite', () => {
|
||||
findAll: jasmine.createSpy('findAll')
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@@ -170,7 +172,7 @@ describe('ResourcePolicyFormComponent test suite', () => {
|
||||
],
|
||||
providers: [
|
||||
{ provide: EPersonDataService, useValue: epersonService },
|
||||
{ provide: FormService, useValue: getMockFormService() },
|
||||
{ provide: FormService, useValue: formService },
|
||||
{ provide: GroupDataService, useValue: groupService },
|
||||
{ provide: RequestService, useValue: getMockRequestService() },
|
||||
FormBuilderService,
|
||||
@@ -189,6 +191,7 @@ describe('ResourcePolicyFormComponent test suite', () => {
|
||||
|
||||
// synchronous beforeEach
|
||||
beforeEach(() => {
|
||||
formService.isValid.and.returnValue(observableOf(true));
|
||||
const html = `
|
||||
<ds-resource-policy-form [resourcePolicy]="resourcePolicy" [isProcessing]="isProcessing"></ds-resource-policy-form>`;
|
||||
|
||||
|
Reference in New Issue
Block a user