tests: fixed tests for new components

This commit is contained in:
2025-02-11 11:33:41 +01:00
committed by appel_c
parent 4602583597
commit 780419835a
3 changed files with 42 additions and 7 deletions

View File

@ -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;

View File

@ -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();
});

View File

@ -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;