Skip to content

Commit

Permalink
Fixed unit test for process
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed May 23, 2024
1 parent 9010db8 commit 95916b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { ProcessTestingModule } from '../testing/process.testing.module';
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
import { AppDefinitionRepresentation } from '@alfresco/js-api';

describe('AppsListComponent', () => {
let loader: HarnessLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
import { ComponentFixture, fakeAsync, getTestBed } from '@angular/core/testing';
import { Observable, of } from 'rxjs';
import {
FormService,
Expand Down Expand Up @@ -54,25 +54,26 @@ describe('RadioButtonsWidgetComponent', () => {
let processDefinitionService: ProcessDefinitionService;

beforeEach(() => {
TestBed.configureTestingModule({
getTestBed().configureTestingModule({
imports: [
TranslateModule.forRoot(),
MatRadioModule,
MatTooltipModule,
MatButtonModule,
FormsModule,
HttpClientTestingModule,
MatIconModule
MatIconModule,
ErrorWidgetComponent
],
declarations: [RadioButtonsWidgetComponent, ErrorWidgetComponent],
declarations: [RadioButtonsWidgetComponent],
providers: [
{ provide: TranslationService, useClass: TranslationMock },
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: AppConfigService, useClass: AppConfigServiceMock }
]
});
taskFormService = TestBed.inject(TaskFormService);
processDefinitionService = TestBed.inject(ProcessDefinitionService);
taskFormService = getTestBed().inject(TaskFormService);
processDefinitionService = getTestBed().inject(ProcessDefinitionService);

formService = new FormService();
widget = new RadioButtonsWidgetComponent(formService, taskFormService, processDefinitionService);
Expand Down Expand Up @@ -186,7 +187,7 @@ describe('RadioButtonsWidgetComponent', () => {
];

beforeEach(() => {
fixture = TestBed.createComponent(RadioButtonsWidgetComponent);
fixture = getTestBed().createComponent(RadioButtonsWidgetComponent);
radioButtonWidget = fixture.componentInstance;
element = fixture.nativeElement;
loader = TestbedHarnessEnvironment.loader(fixture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppConfigService, AppConfigServiceMock, LocalizedDatePipe, TemplateModule, TranslationMock, TranslationService } from '@alfresco/adf-core';
import { AppsProcessService } from '../../app-list/services/apps-process.service';
import { of, throwError } from 'rxjs';
import { MatSelectChange } from '@angular/material/select';
import { MatSelectChange, MatSelectModule } from '@angular/material/select';
import { ProcessService } from '../services/process.service';
import { newProcess, taskFormMock, testProcessDef, testMultipleProcessDefs, testProcessDefWithForm, testProcessDefinitions } from '../../mock';
import { StartProcessInstanceComponent } from './start-process.component';
Expand All @@ -38,6 +38,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { RestVariable } from '@alfresco/js-api';

describe('StartProcessComponent', () => {
let appConfig: AppConfigService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import { CoreTestingModule, UserInfoMode } from '@alfresco/adf-core';
import { fakeEcmUser, fakeEcmUserNoImage } from '@alfresco/adf-content-services';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatMenuModule } from '@angular/material/menu';
import { By } from '@angular/platform-browser';
import { ProcessUserInfoComponent } from './process-user-info.component';
import { HarnessLoader } from '@angular/cdk/testing';
Expand Down

0 comments on commit 95916b7

Please sign in to comment.