Skip to content

Commit

Permalink
test: Isolate test files
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner authored and jmacura committed Feb 13, 2024
1 parent 2ee1249 commit c11254d
Show file tree
Hide file tree
Showing 63 changed files with 247 additions and 241 deletions.
1 change: 1 addition & 0 deletions projects/hslayers/components/draw/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './draw-layer-metadata/draw-layer-metadata.component';
export * from './draw-toolbar/draw-toolbar.component';
export * from './draw.component';
export * from './draw.module';
export * from './draw-panel/draw-panel.component';
1 change: 1 addition & 0 deletions projects/hslayers/components/language/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './language.component';
export * from './language.module';
export * from './translate-testing.module';
12 changes: 6 additions & 6 deletions projects/hslayers/components/print/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export {PrintModule} from './print.module';
// export * from './types/text-style.type';
// export * from './types/scale-object.type';
// export * from './types/legend-object.type';
// export * from './text-styler/text-styler.component';
// export * from './scale-styler/scale-styler.component';
// export * from './legend-styler/legend-styler.component';
export * from './text-styler/text-styler.component';
export * from './scale-styler/scale-styler.component';
export * from './legend-styler/legend-styler.component';
// export * from './types/styler.type';
// export * from './constants/scale-svg-classes';
// export * from './constants/scale-styling-options';
// export * from './print-legend.service';
export * from './print-legend.service';
// export * from './print-title.service';
// export * from './print-scale.service';
export * from './print-scale.service';
// export * from './print-imprint.service';
// export * from './imprint-styler/imprint-styler.component';
export * from './imprint-styler/imprint-styler.component';
1 change: 0 additions & 1 deletion projects/hslayers/components/share/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './share-url.service';
export * from './share.component';
export * from './share.module';
export * from './share.service';
export * from './share-url.service.mock';
1 change: 0 additions & 1 deletion projects/hslayers/config/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './config.service';
export * from './config.service.mock';
1 change: 0 additions & 1 deletion projects/hslayers/shared/event-bus/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from '../event-bus/event-bus.service';
export * from '../event-bus/event-bus.service.mock';
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {HsLayoutService} from 'hslayers-ng/shared/layout';
import {HsLogService} from 'hslayers-ng/shared/log';
import {HsMapService} from 'hslayers-ng/shared/map';
import {HsQueryBaseService} from 'hslayers-ng/shared/query';
import {HsQueryPopupService} from '../query/query-popup.service';
import {HsQueryPopupService} from 'hslayers-ng/components/query';
import {HsQueryVectorService} from 'hslayers-ng/shared/query';
import {HsUtilsService} from 'hslayers-ng/shared/utils';

Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions projects/hslayers/shared/external/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"entryFile": "public-api.ts"
}
}
1 change: 0 additions & 1 deletion projects/hslayers/shared/layout/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './layout.service';
export * from './layout.service.mock';
1 change: 0 additions & 1 deletion projects/hslayers/shared/map/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './map.service';
export * from './map.service.mock';
1 change: 0 additions & 1 deletion projects/hslayers/shared/save-map/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './layman.service';
export * from './save-map.service';
export * from './save-map.service.mock';
export * from './layer-synchronizer.service';
export * from './saver-service.interface';
1 change: 0 additions & 1 deletion projects/hslayers/shared/styler/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './styler.service';
export * from './styler.service.mock';
export * from './backwards-compatibility';
export * from './default-style';
1 change: 0 additions & 1 deletion projects/hslayers/shared/utils/public-api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './layer-utils.service';
export * from './utils.service.mock';
export * from './utils.service';
22 changes: 11 additions & 11 deletions projects/hslayers/src/hslayers.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {Component, Input, OnInit, Type, ViewChild} from '@angular/core';

import {HsConfig, HsConfigObject} from './config.service';
// import {HsFeatureInfoComponent} from './components/query/query-popup-feature/feature-widgets/feature-info.component';
import {HsExternalService} from './components/external/external.service';
import {HsLayoutComponent} from './components/layout/layout.component';
import {HsMapSwipeService} from './components/map-swipe/map-swipe.service';
import {HsQueryPopupComponent} from './components/query/query-popup/query-popup.component';
import {HsQueryPopupService} from './components/query/query-popup.service';
import {HsQueryPopupWidgetContainerService} from './components/query/query-popup-widget-container.service';

import {HsOverlayPanelContainerService} from './components/layout/overlay-panel-container.service';
import {HsPanelConstructorService} from './components/layout/panels/panel-constructor.service';
import {HsConfig, HsConfigObject} from 'hslayers-ng/config';
// import {HsFeatureInfoComponent} from 'hslayers-ng/components/query/query-popup-feature/feature-widgets/feature-info.component';
import {HsExternalService} from 'hslayers-ng/shared/external';
import {HsLayoutComponent} from 'hslayers-ng/components/layout';
import {HsMapSwipeService} from 'hslayers-ng/components/map-swipe';
import {HsQueryPopupComponent} from 'hslayers-ng/components/query';
import {HsQueryPopupService} from 'hslayers-ng/components/query';
import {HsQueryPopupWidgetContainerService} from 'hslayers-ng/components/query';

import {HsOverlayPanelContainerService} from 'hslayers-ng/shared/panels';
import {HsPanelConstructorService} from 'hslayers-ng/shared/panels';

@Component({
// eslint-disable-next-line @angular-eslint/component-selector
Expand Down
2 changes: 1 addition & 1 deletion projects/hslayers/src/hslayers.layman.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import {Injectable} from '@angular/core';
import {Observable, map} from 'rxjs';

import {HsCommonLaymanService} from './common/layman/layman.service';
import {HsCommonLaymanService} from 'hslayers-ng/common/layman';

@Injectable()
export class HslayersLaymanInterceptor implements HttpInterceptor {
Expand Down
42 changes: 20 additions & 22 deletions projects/hslayers/src/hslayers.module.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
import {HTTP_INTERCEPTORS} from '@angular/common/http';
import {NgModule} from '@angular/core';

import {HsAddDataModule} from './components/add-data/add-data.module';
import {HsCompositionsModule} from './components/compositions/compositions.module';
import {HsCoreModule} from './components/core/core.module';
import {HsDrawModule} from './components/draw/draw.module';
import {HsFeatureTableModule} from './components/feature-table/feature-table.module';
import {HsGeolocationModule} from './components/geolocation/geolocation.module';
import {HsInfoModule} from './components/info/info.module';
import {HsLanguageModule} from './components/language/language.module';
import {HsLayerManagerModule} from './components/layer-manager/layer-manager.module';
import {HsLayoutModule} from './components/layout/layout.module';
import {HsLegendModule} from './components/legend/legend.module';
import {HsMapSwipeModule} from './components/map-swipe/map-swipe.module';
import {HsMeasureModule} from './components/measure/measure.module';
import {HsQueryModule} from './components/query/query.module';
import {HsSaveMapModule} from './components/save-map/save-map.module';
import {HsSearchModule} from './components/search/search.module';
import {HsShareModule} from './components/share/share.module';
import {HsStylerModule} from './components/styler/styles.module';
import {HsToolbarModule} from './components/toolbar/toolbar.module';
import {HsTripPlannerModule} from './components/trip-planner/trip-planner.module';
import {HsAddDataModule} from 'hslayers-ng/components/add-data';
import {HsCompositionsModule} from 'hslayers-ng/components/compositions';
import {HsDrawModule} from 'hslayers-ng/components/draw';
import {HsFeatureTableModule} from 'hslayers-ng/components/feature-table';
import {HsGeolocationModule} from 'hslayers-ng/components/geolocation';
import {HsInfoModule} from 'hslayers-ng/components/info';
import {HsLanguageModule} from 'hslayers-ng/components/language';
import {HsLayerManagerModule} from 'hslayers-ng/components/layer-manager';
import {HsLayoutModule} from 'hslayers-ng/components/layout';
import {HsLegendModule} from 'hslayers-ng/components/legend';
import {HsMapSwipeModule} from 'hslayers-ng/components/map-swipe';
import {HsMeasureModule} from 'hslayers-ng/components/measure';
import {HsQueryModule} from 'hslayers-ng/components/query';
import {HsSaveMapModule} from 'hslayers-ng/components/save-map';
import {HsSearchModule} from 'hslayers-ng/components/search';
import {HsShareModule} from 'hslayers-ng/components/share';
import {HsStylerModule} from 'hslayers-ng/components/styler';
import {HsToolbarModule} from 'hslayers-ng/components/toolbar';
import {HsTripPlannerModule} from 'hslayers-ng/components/trip-planner';
import {HslayersComponent} from './hslayers.component';
import {HslayersLaymanInterceptor} from './hslayers.layman.interceptor';
import {PrintModule} from './components/print/print.module';
import {PrintModule} from 'hslayers-ng/components/print';

@NgModule({
declarations: [HslayersComponent],
imports: [
HsCoreModule,
HsLayoutModule,
HsLayerManagerModule,
HsMeasureModule,
Expand Down
6 changes: 3 additions & 3 deletions projects/hslayers/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* Public API Surface of hslayers
*/

// export * from './hslayers.service';
// export * from './hslayers.component';
// export * from './hslayers.module';
export * from './hslayers.service';
export * from './hslayers.component';
export * from './hslayers.module';

/**
* SHARED SERVICES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,26 @@ import {FormsModule} from '@angular/forms';
import {HttpClient, HttpClientModule} from '@angular/common/http';
import {lastValueFrom} from 'rxjs';

import {HsAddDataUrlComponent} from './add-data-url.component';
import {HsAddDataVectorModule} from '../vector/vector.module';
import {HsAddDataUrlComponent} from 'hslayers-ng/components/add-data';
import {HsAddDataVectorModule} from 'hslayers-ng/components/add-data';
import {HsConfig} from 'hslayers-ng/config';
import {HsConfigMock} from 'hslayers-ng/config';
import {HsConfigMock} from './config.service.mock';
import {HsLanguageModule} from 'hslayers-ng/components/language';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsLayoutService} from 'hslayers-ng/shared/layout';
import {HsLayoutServiceMock} from 'hslayers-ng/shared/layout';
import {HsMapService, HsMapServiceMock} from 'hslayers-ng/shared/map';
import {HsUrlArcGisModule} from './arcgis/arcgis.module';
import {HsUrlGeoSparqlModule} from './geosparql/geosparql.module';
import {HsUrlWfsModule} from './wfs/wfs.module';
import {HsUrlWmsModule} from './wms/wms.module';
import {HsUrlWmtsModule} from './wmts/wmts.module';
import {HsLayoutServiceMock} from './layout.service.mock';
import {HsMapService} from 'hslayers-ng/shared/map';
import {HsMapServiceMock} from './map.service.mock';
import {HsUrlArcGisModule} from 'hslayers-ng/components/add-data';
import {HsUrlGeoSparqlModule} from 'hslayers-ng/components/add-data';
import {HsUrlWfsModule} from 'hslayers-ng/components/add-data';
import {HsUrlWmsModule} from 'hslayers-ng/components/add-data';
import {HsUrlWmtsModule} from 'hslayers-ng/components/add-data';
import {HsUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from './utils.service.mock';
import {HsWmsGetCapabilitiesService} from 'hslayers-ng/shared/get-capabilities';
import {mockLayerUtilsService} from 'hslayers-ng/testing';
import {testingServiceEndpoints} from 'hslayers-ng/testing';
import {mockLayerUtilsService} from './layer-utils.service.mock';
import {testingServiceEndpoints} from './data/service-endpoints';

let httpClient;
let hsWmsGetCapabilitiesService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ import {NgbDropdownModule} from '@ng-bootstrap/ng-bootstrap';
import {HsAddDataVectorService} from 'hslayers-ng/shared/add-data';
import {HsCommonEndpointsService} from 'hslayers-ng/shared/endpoints';
import {HsCommonLaymanService} from 'hslayers-ng/common/layman';
import {HsCompositionsCatalogueService} from './compositions-catalogue.service';
import {HsCompositionsComponent} from './compositions.component';
import {HsCompositionsCatalogueService} from 'hslayers-ng/components/compositions';
import {HsCompositionsComponent} from 'hslayers-ng/components/compositions';
import {HsCompositionsLayerParserService} from 'hslayers-ng/shared/compositions';
import {HsCompositionsMapService} from './compositions-map.service';
import {HsCompositionsMickaService} from './endpoints/compositions-micka.service';
import {HsCompositionsService} from './compositions.service';
import {HsCompositionsMapService} from 'hslayers-ng/components/compositions';
import {HsCompositionsMickaService} from 'hslayers-ng/components/compositions';
import {HsCompositionsService} from 'hslayers-ng/components/compositions';
import {HsConfig} from 'hslayers-ng/config';
import {HsConfigMock} from 'hslayers-ng/config';
import {HsConfigMock} from './config.service.mock';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsLayoutService} from 'hslayers-ng/shared/layout';
import {HsLayoutServiceMock} from 'hslayers-ng/shared/layout';
import {HsLayoutServiceMock} from './layout.service.mock';
import {HsMapService} from 'hslayers-ng/shared/map';
import {HsMapServiceMock} from 'hslayers-ng/shared/map';
import {HsMapServiceMock} from './map.service.mock';
import {HsPanelHeaderComponent} from 'hslayers-ng/common/panels';
import {HsPanelHelpersModule} from 'hslayers-ng/common/panels';
import {HsSaveMapService} from 'hslayers-ng/shared/save-map';
import {HsSaveMapServiceMock} from 'hslayers-ng/shared/save-map';
import {HsSaveMapServiceMock} from './save-map.service.mock';
import {HsStylerModule} from 'hslayers-ng/components/styler';
import {HsStylerService} from 'hslayers-ng/shared/styler';
import {HsUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from './utils.service.mock';
import {TranslateCustomPipe} from 'hslayers-ng/shared/language';
import {compositionJson} from '../../../test/data/composition';
import {compositionsJson} from '../../../test/data/compositions';
import {compositionJson} from './data/composition';
import {compositionsJson} from './data/compositions';
import {getTitle} from 'hslayers-ng/common/extensions';
import {mockLayerUtilsService} from 'hslayers-ng/testing';
import {mockLayerUtilsService} from './layer-utils.service.mock';

class HsCompositionsMickaServiceMock {
constructor(private originalService: HsCompositionsMickaService) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {Subject} from 'rxjs';

import {HsConfig} from './config.service';

export class HsConfigMock {
reverseLayerList: boolean;
panelsEnabled = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import {
import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {TestBed} from '@angular/core/testing';

import {HsDimensionTimeService} from './dimension-time.service';
import {HsDimensionTimeService} from 'hslayers-ng//shared/get-capabilities';
import {HsEventBusService} from 'hslayers-ng/shared/event-bus';
import {HsEventBusServiceMock} from 'hslayers-ng/shared/core';
import {HsEventBusServiceMock} from './event-bus.service.mock';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from 'hslayers-ng/shared/utils';
import {mockLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from './utils.service.mock';
import {mockLayerUtilsService} from './layer-utils.service.mock';

describe('HsGetCapabilitiesModule', () => {
beforeAll(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,29 @@ import {NgbDropdownModule} from '@ng-bootstrap/ng-bootstrap';
import {Vector as VectorLayer} from 'ol/layer';
import {Vector as VectorSource} from 'ol/source';

import {DrawPanelComponent} from './draw-panel.component';
import {DrawPanelComponent} from 'hslayers-ng/components/draw';
import {HsAddDataOwsService} from 'hslayers-ng/shared/add-data';
import {HsAddDataVectorService} from 'hslayers-ng/shared/add-data';
import {HsCommonEndpointsService} from 'hslayers-ng/shared/endpoints';
import {HsCommonLaymanService} from 'hslayers-ng/common/layman';
import {HsConfig} from 'hslayers-ng/config';
import {HsConfigMock} from 'hslayers-ng/config';
import {HsConfigMock} from './config.service.mock';

import {HsDrawService} from 'hslayers-ng/shared/draw';
import {HsLanguageService} from 'hslayers-ng/shared/language';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsLaymanBrowserService} from 'hslayers-ng/components/add-data';
import {HsLaymanBrowserService} from 'hslayers-ng/shared/add-data';
import {HsLaymanService} from 'hslayers-ng/shared/save-map';
import {HsLayoutService} from 'hslayers-ng/shared/layout';
import {HsLayoutServiceMock} from 'hslayers-ng/shared/layout';
import {HsLayoutServiceMock} from './layout.service.mock';
import {HsMapService} from 'hslayers-ng/shared/map';
import {HsMapServiceMock} from 'hslayers-ng/shared/map';
import {HsMapServiceMock} from './map.service.mock';
import {HsQueryBaseService} from 'hslayers-ng/shared/query';
import {HsQueryVectorService} from 'hslayers-ng/shared/query';
import {HsUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from './utils.service.mock';
import {TranslateCustomPipe} from 'hslayers-ng/shared/language';
import {mockLayerUtilsService} from 'hslayers-ng/shared/utils';
import {mockLayerUtilsService} from './layer-utils.service.mock';
class emptyMock {
constructor() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';

import {CustomTranslationService} from './components/language/custom-translate.service';
import {HsConfig} from './config.service';
import {CustomTranslationService} from 'hslayers-ng/shared/language';
import {HsConfig} from 'hslayers-ng/config';
import {HsConfigMock} from './config.service.mock';
import {HsLayerUtilsService} from './components/utils/layer-utils.service';
import {HsPanelConstructorService} from './components/layout/panels/panel-constructor.service';
import {HsUtilsService} from './components/utils/utils.service';
import {HsUtilsServiceMock} from './components/utils/utils.service.mock';
import {HslayersComponent} from './hslayers.component';
import {TranslateTestingModule} from './components/language/translate-testing.module';
import {mockLayerUtilsService} from './components/utils/layer-utils.service.mock';
import {HsLayerUtilsService} from 'hslayers-ng/shared/utils';
import {HsPanelConstructorService} from 'hslayers-ng/shared/panels';
import {HsUtilsService} from 'hslayers-ng/shared/utils';
import {HsUtilsServiceMock} from './utils.service.mock';
import {HslayersComponent} from 'hslayers-ng';
import {TranslateTestingModule} from 'hslayers-ng/components/language';
import {mockLayerUtilsService} from './layer-utils.service.mock';

describe('HslayersComponent', () => {
let component: HslayersComponent;
Expand Down
Loading

0 comments on commit c11254d

Please sign in to comment.