Skip to content

Commit

Permalink
fix tests keyresult-dialog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 4, 2024
1 parent 88c26f3 commit b9ab36f
Showing 1 changed file with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/materia
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatInputModule } from '@angular/material/input';
import { ReactiveFormsModule } from '@angular/forms';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatIconModule } from '@angular/material/icon';
import { By } from '@angular/platform-browser';
import { testUser, users } from '../../shared/testData';
Expand All @@ -16,14 +15,18 @@ import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatSelectModule } from '@angular/material/select';
import { MatRadioModule } from '@angular/material/radio';
import { KeyResultObjective } from '../../shared/types/model/KeyResultObjective';
import { DialogHeaderComponent } from '../../shared/custom/dialog-header/dialog-header.component';
import { OAuthService } from 'angular-oauth2-oidc';
import { KeyresultTypeComponent } from '../keyresult-type/keyresult-type.component';
import { ActionPlanComponent } from '../action-plan/action-plan.component';
import { TranslateModule, TranslateService } from '@ngx-translate/core';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { UserService } from '../../services/user.service';
import { KeyResultFormComponent } from '../key-result-form/key-result-form.component';
import { provideRouter } from '@angular/router';
import { provideHttpClient } from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { MatDividerModule } from '@angular/material/divider';
import { DialogTemplateCoreComponent } from '../../shared/custom/dialog-template-core/dialog-template-core.component';

describe('KeyresultDialogComponent', () => {
let component: KeyresultDialogComponent;
Expand Down Expand Up @@ -253,7 +256,6 @@ describe('KeyresultDialogComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
HttpClientTestingModule,
MatDialogModule,
NoopAnimationsModule,
MatSelectModule,
Expand All @@ -264,8 +266,12 @@ describe('KeyresultDialogComponent', () => {
MatIconModule,
TranslateModule.forRoot(),
DragDropModule,
MatDividerModule,
],
providers: [
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
TranslateService,
{ provide: UserService, useValue: userService },
Expand All @@ -285,9 +291,9 @@ describe('KeyresultDialogComponent', () => {
declarations: [
KeyresultDialogComponent,
KeyResultFormComponent,
DialogHeaderComponent,
KeyresultTypeComponent,
ActionPlanComponent,
DialogTemplateCoreComponent,
],
}).compileComponents();

Expand Down Expand Up @@ -408,13 +414,16 @@ describe('KeyresultDialogComponent', () => {
NoopAnimationsModule,
MatInputModule,
ReactiveFormsModule,
HttpClientTestingModule,
MatIconModule,
MatAutocompleteModule,
DragDropModule,
TranslateModule.forRoot(),
MatDividerModule,
],
providers: [
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
{
provide: MatDialogRef,
Expand All @@ -434,7 +443,7 @@ describe('KeyresultDialogComponent', () => {
declarations: [
KeyresultDialogComponent,
KeyResultFormComponent,
DialogHeaderComponent,
DialogTemplateCoreComponent,
ActionPlanComponent,
KeyresultTypeComponent,
],
Expand Down Expand Up @@ -553,13 +562,16 @@ describe('KeyresultDialogComponent', () => {
NoopAnimationsModule,
MatInputModule,
ReactiveFormsModule,
HttpClientTestingModule,
MatIconModule,
MatAutocompleteModule,
DragDropModule,
TranslateModule.forRoot(),
MatDividerModule,
],
providers: [
provideRouter([]),
provideHttpClient(),
provideHttpClientTesting(),
KeyresultService,
{
provide: MatDialogRef,
Expand All @@ -577,7 +589,7 @@ describe('KeyresultDialogComponent', () => {
declarations: [
KeyresultDialogComponent,
KeyResultFormComponent,
DialogHeaderComponent,
DialogTemplateCoreComponent,
ActionPlanComponent,
KeyresultTypeComponent,
],
Expand Down

0 comments on commit b9ab36f

Please sign in to comment.