diff --git a/frontend/bec_atlas/src/app/scan-table/column-selection-dialog/column-selection-dialog.component.spec.ts b/frontend/bec_atlas/src/app/scan-table/column-selection-dialog/column-selection-dialog.component.spec.ts index fa5392c..645ab9c 100644 --- a/frontend/bec_atlas/src/app/scan-table/column-selection-dialog/column-selection-dialog.component.spec.ts +++ b/frontend/bec_atlas/src/app/scan-table/column-selection-dialog/column-selection-dialog.component.spec.ts @@ -1,6 +1,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ColumnSelectionDialogComponent } from './column-selection-dialog.component'; +import { + MatDialogModule, + MAT_DIALOG_DATA, + MatDialogRef, +} from '@angular/material/dialog'; describe('ColumnSelectionDialogComponent', () => { let component: ColumnSelectionDialogComponent; @@ -8,9 +13,21 @@ describe('ColumnSelectionDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ColumnSelectionDialogComponent] - }) - .compileComponents(); + providers: [ + { + provide: MAT_DIALOG_DATA, + useValue: [ + { name: 'column1', selected: true }, + { name: 'column2', selected: false }, + ], + }, + { + provide: MatDialogRef, + useValue: {}, + }, + ], + imports: [ColumnSelectionDialogComponent, MatDialogModule], + }).compileComponents(); fixture = TestBed.createComponent(ColumnSelectionDialogComponent); component = fixture.componentInstance; diff --git a/frontend/bec_atlas/src/app/scan-table/scan-table.component.spec.ts b/frontend/bec_atlas/src/app/scan-table/scan-table.component.spec.ts index c5175d2..9ab5efb 100644 --- a/frontend/bec_atlas/src/app/scan-table/scan-table.component.spec.ts +++ b/frontend/bec_atlas/src/app/scan-table/scan-table.component.spec.ts @@ -1,5 +1,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ScanTableComponent } from './scan-table.component'; +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { AppConfigService } from '../app-config.service'; +import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; describe('ScanTableComponent', () => { let component: ScanTableComponent; @@ -7,7 +11,12 @@ describe('ScanTableComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ScanTableComponent], + providers: [ + provideHttpClient(), + provideHttpClientTesting(), + provideAnimationsAsync(), + AppConfigService, + ], }).compileComponents(); }); diff --git a/frontend/bec_atlas/src/app/scan-table/side-panel/side-panel.component.spec.ts b/frontend/bec_atlas/src/app/scan-table/side-panel/side-panel.component.spec.ts index 26c22d1..07490d8 100644 --- a/frontend/bec_atlas/src/app/scan-table/side-panel/side-panel.component.spec.ts +++ b/frontend/bec_atlas/src/app/scan-table/side-panel/side-panel.component.spec.ts @@ -1,6 +1,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SidePanelComponent } from './side-panel.component'; +import { provideHttpClient } from '@angular/common/http'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { AppConfigService } from '../../app-config.service'; +import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; describe('SidePanelComponent', () => { let component: SidePanelComponent; @@ -8,9 +12,14 @@ describe('SidePanelComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [SidePanelComponent] - }) - .compileComponents(); + providers: [ + provideHttpClient(), + provideHttpClientTesting(), + provideAnimationsAsync(), + AppConfigService, + ], + imports: [SidePanelComponent], + }).compileComponents(); fixture = TestBed.createComponent(SidePanelComponent); component = fixture.componentInstance;