119612: fix spec test

(cherry picked from commit 6232d4e9cf)
This commit is contained in:
Jens Vannerum
2025-04-29 12:20:25 +02:00
parent 5b19ebe48c
commit dabc3b400b

View File

@@ -2,6 +2,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { of as observableOf } from 'rxjs';
import { TranslateModule } from '@ngx-translate/core';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ConfigurationDataService } from '../../../core/data/configuration-data.service';
import { AuthorizationDataService } from '../../../core/data/feature-authorization/authorization-data.service';
import { SearchExportCsvComponent } from './search-export-csv.component';
import { ScriptDataService } from '../../../core/data/processes/script-data.service';
@@ -23,6 +24,7 @@ describe('SearchExportCsvComponent', () => {
let authorizationDataService: AuthorizationDataService;
let notificationsService;
let router;
let configurationDataService: jasmine.SpyObj<ConfigurationDataService>;
const process = Object.assign(new Process(), {processId: 5, scriptName: 'metadata-export-search'});
@@ -37,6 +39,10 @@ describe('SearchExportCsvComponent', () => {
]
});
configurationDataService = jasmine.createSpyObj('ConfigurationDataService', {
findByPropertyName: observableOf({ payload: { value: '500' } }),
});
function initBeforeEachAsync() {
scriptDataService = jasmine.createSpyObj('scriptDataService', {
scriptWithNameExistsAndCanExecute: observableOf(true),
@@ -57,6 +63,7 @@ describe('SearchExportCsvComponent', () => {
{provide: AuthorizationDataService, useValue: authorizationDataService},
{provide: NotificationsService, useValue: notificationsService},
{provide: Router, useValue: router},
{ provide: ConfigurationDataService, useValue: configurationDataService },
]
}).compileComponents();
}