Skip to content

Commit

Permalink
fix tests by adding created pipe as provider to test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
Vakmeth committed Oct 4, 2023
1 parent 0f11e17 commit 888afb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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 { Unit } from '../../../types/enums/Unit';
import { ParseUnitValuePipe } from '../../../pipes/parse-unit-value/parse-unit-value.pipe';

describe('CheckInFormComponent', () => {
let component: CheckInFormMetricComponent;
Expand All @@ -26,7 +27,7 @@ describe('CheckInFormComponent', () => {
ReactiveFormsModule,
],
declarations: [CheckInFormMetricComponent],
providers: [UnitValueTransformationPipe],
providers: [UnitValueTransformationPipe, ParseUnitValuePipe],
});
fixture = TestBed.createComponent(CheckInFormMetricComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ReactiveFormsModule } from '@angular/forms';
import { MatInputModule } from '@angular/material/input';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { ParseUnitValuePipe } from '../../../pipes/parse-unit-value/parse-unit-value.pipe';

const dialogMock = {
close: jest.fn(),
Expand All @@ -36,6 +37,7 @@ describe('CheckInFormComponent', () => {
providers: [
{ provide: MAT_DIALOG_DATA, useValue: { keyResult: {} } },
{ provide: MatDialogRef, useValue: dialogMock },
ParseUnitValuePipe,
],
declarations: [CheckInFormComponent],
});
Expand Down

0 comments on commit 888afb9

Please sign in to comment.