Skip to content

Commit

Permalink
Fix frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lkleisa committed Dec 7, 2023
1 parent 4b23787 commit 438e9cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/app/action-plan/action-plan.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ActionService } from '../shared/services/action.service';
import { action1, action2, action3, addedAction } from '../shared/testData';
import { BehaviorSubject, of } from 'rxjs';
import { Action } from '../shared/types/model/Action';
import { TranslateModule, TranslateService } from '@ngx-translate/core';

const actionServiceMock = {
deleteAction: jest.fn(),
Expand All @@ -21,8 +22,9 @@ describe('ActionPlanComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ActionPlanComponent],
imports: [HttpClientTestingModule, MatDialogModule, CdkDropList, CdkDrag],
imports: [HttpClientTestingModule, MatDialogModule, CdkDropList, CdkDrag, TranslateModule.forRoot()],
providers: [
TranslateService,
{
provide: ActionService,
useValue: actionServiceMock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MatSelectModule } from '@angular/material/select';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { ReactiveFormsModule } from '@angular/forms';
import { TranslateModule, TranslateService } from '@ngx-translate/core';

const dialogMock = {
close: jest.fn(),
Expand All @@ -29,9 +30,11 @@ describe('ConfirmDialogComponent', () => {
MatInputModule,
MatRadioModule,
ReactiveFormsModule,
TranslateModule.forRoot(),
],
declarations: [ConfirmDialogComponent],
providers: [
TranslateService,
{ provide: MAT_DIALOG_DATA, useValue: {} },
{ provide: MatDialogRef, useValue: dialogMock },
],
Expand Down

0 comments on commit 438e9cf

Please sign in to comment.