Skip to content

Commit

Permalink
test(App): test component creation
Browse files Browse the repository at this point in the history
  • Loading branch information
cboucheIGN committed Nov 27, 2024
1 parent 7cea1ce commit b8825ad
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { RequeteExportListComponent } from './requete-export-list.component';
import { SharedDesignDsfrModule } from '../../../shared-design-dsfr/shared-design-dsfr.module';

describe('RequeteExportListComponent', () => {
let component: RequeteExportListComponent;
let fixture: ComponentFixture<RequeteExportListComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [RequeteExportListComponent]
})
.compileComponents();
declarations: [RequeteExportListComponent],
imports: [SharedDesignDsfrModule]
}).compileComponents();

fixture = TestBed.createComponent(RequeteExportListComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CommonModule } from '@angular/common';

import { appConfig } from '../../../app.config';
import { RequetePrinterComponent } from './requete-printer.component';
import { ThematicListComponent } from '../../../shared-thematic/components/thematic-list/thematic-list.component';
import { SharedDesignDsfrModule } from '../../../shared-design-dsfr/shared-design-dsfr.module';
import { SharedMapModule } from '../../../shared-map/shared-map.module';
import { SyntheseComponent } from '../../../shared-thematic/components/synthese/synthese.component';
import { FicheInfoViewComponent } from '../../../shared-thematic/components/fiche-info-view/fiche-info-view.component';
import { LayerInfoViewComponent } from '../../../shared-thematic/components/layer-info-view/layer-info-view.component';
import { MapViewerComponent } from '../../../shared-map/components/map-viewer/map-viewer.component';


describe('ThematicListComponent', () => {
let component: ThematicListComponent;
let fixture: ComponentFixture<ThematicListComponent>;
describe('RequetePrinterComponent', () => {
let component: RequetePrinterComponent;
let fixture: ComponentFixture<RequetePrinterComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ThematicListComponent],
declarations: [
RequetePrinterComponent,
ThematicListComponent,
SyntheseComponent,
FicheInfoViewComponent,
LayerInfoViewComponent,
MapViewerComponent
],
imports: [
CommonModule,
SharedDesignDsfrModule,
SharedMapModule,
],
providers: appConfig.providers
}).compileComponents();

fixture = TestBed.createComponent(ThematicListComponent);
fixture = TestBed.createComponent(RequetePrinterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});

});
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ThematicListComponent } from './thematic-list.component';
import { BrowserModule } from '@angular/platform-browser';

import { FicheInfoViewComponent } from '../../../shared-thematic/components/fiche-info-view/fiche-info-view.component';
import { appConfig } from '../../../app.config';
import { ThematicListComponent } from './thematic-list.component';
import { FicheInfoViewComponent } from '../../../shared-thematic/components/fiche-info-view/fiche-info-view.component';
import { LayerInfoViewComponent } from '../../../shared-thematic/components/layer-info-view/layer-info-view.component';
import { SyntheseComponent } from '../synthese/synthese.component';

import { appConfig } from '../../../app.config';
import { CommonModule } from '@angular/common';
import { SharedDesignDsfrModule } from '../../../shared-design-dsfr/shared-design-dsfr.module';
import { SharedMapModule } from '../../../shared-map/shared-map.module';
import { MapViewerComponent } from '../../../shared-map/components/map-viewer/map-viewer.component';


describe('ThematicListComponent', () => {
Expand All @@ -14,11 +18,20 @@ describe('ThematicListComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ThematicListComponent, SyntheseComponent, FicheInfoViewComponent, LayerInfoViewComponent],
imports: [],
declarations: [
ThematicListComponent,
SyntheseComponent,
FicheInfoViewComponent,
LayerInfoViewComponent,
MapViewerComponent,
],
imports: [
CommonModule,
SharedDesignDsfrModule,
SharedMapModule,
],
providers: appConfig.providers
})
.compileComponents();
}).compileComponents();

fixture = TestBed.createComponent(ThematicListComponent);
component = fixture.componentInstance;
Expand All @@ -28,4 +41,5 @@ describe('ThematicListComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import { FicheInfoFeatureService } from '../../services/fiche-info-feature.servi
import { THEMATIC_FICHE_LIST } from '../../models/thematic-fiche-list';

@Component({

selector: 'app-thematic-list',
templateUrl: './thematic-list.component.html',
styleUrl: './thematic-list.component.css'

})

export class ThematicListComponent {

selectedTabIndex: number = 0;
Expand All @@ -27,7 +24,7 @@ export class ThematicListComponent {
) { }

ngOnInit() {

this.initFicheList();

this.thematicSelectService.thematicSelection.subscribe((activeThemeList: any[]) => {
Expand All @@ -47,8 +44,8 @@ export class ThematicListComponent {


selectTab(event: any) {
this.setSelectedTabIndex(event);
this.mapContextService.updateLayersVisibility(event);
this.setSelectedTabIndex(event);
this.mapContextService.updateLayersVisibility(event);
}


Expand Down
2 changes: 1 addition & 1 deletion src/app/shared-thematic/shared-thematic.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { SharedDesignDsfrModule } from '../shared-design-dsfr/shared-design-dsfr.module';
import { SyntheseComponent } from './components/synthese/synthese.component';
import { ThematicSelectComponent } from './components/thematic-select/thematic-select.component';
Expand All @@ -11,7 +12,6 @@ import { ReglementationViewComponent } from './components/reglementation-view/re
import { SharedMapModule } from '../shared-map/shared-map.module';



@NgModule({
declarations: [
SyntheseComponent,
Expand Down

0 comments on commit b8825ad

Please sign in to comment.