mirror of
https://github.com/bec-project/bec_atlas.git
synced 2025-07-13 22:51:49 +02:00
tests: fixed tests for new components
This commit is contained in:
@ -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;
|
||||
|
@ -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();
|
||||
});
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user