Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michelu89 committed Apr 18, 2024
1 parent ad929a9 commit ac214dc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {EditorDialogValidators} from '../../../editor-dialog';
import {finalize, first} from 'rxjs/operators';
import {map, Subscription} from 'rxjs';
import {saveAs} from 'file-saver';
import {EditorService, GenerateService} from '../../../services';
import {GenerateService} from '../../../services';
import {ModelService} from '@ame/rdf/services';
import {LanguageTranslationService} from '@ame/translation';
import {NotificationsService} from '@ame/shared';
Expand Down
14 changes: 14 additions & 0 deletions core/libs/editor/src/lib/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2024 Robert Bosch Manufacturing Solutions GmbH
*
* See the AUTHORS file(s) distributed with this work for
* additional information regarding authorship.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* SPDX-License-Identifier: MPL-2.0
*/

export * from './form-field.helper';
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@
* SPDX-License-Identifier: MPL-2.0
*/
import {MigratorApiService, ModelApiService} from '@ame/api';
import {EditorService} from '@ame/editor';
import {LoadAspectModelService} from '@ame/editor';
import {RdfService} from '@ame/rdf/services';
import {APP_CONFIG} from '@ame/shared';
import {APP_CONFIG, ElectronTunnelService} from '@ame/shared';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatDialogModule} from '@angular/material/dialog';
import {MatIconModule} from '@angular/material/icon';
import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {RouterTestingModule} from '@angular/router/testing';
import {provideMockObject} from 'jest-helpers';
import {of} from 'rxjs';
import {ElectronTunnelService} from '@ame/shared';

import {VersionMigrationComponent} from './version-migration.component';
import {TranslateModule} from '@ngx-translate/core';
Expand All @@ -31,6 +30,7 @@ describe('VersionMigrationComponent', () => {
let component: VersionMigrationComponent;
let fixture: ComponentFixture<VersionMigrationComponent>;
let modelApiService: ModelApiService;
let loadAspectModelService: LoadAspectModelService;

beforeEach(() => {
TestBed.configureTestingModule({
Expand Down Expand Up @@ -67,10 +67,9 @@ describe('VersionMigrationComponent', () => {
useValue: provideMockObject(ModelApiService),
},
{
provide: EditorService,
provide: LoadAspectModelService,
useValue: {
settings: {},
loadExternalModels: jest.fn(() => of()),
},
},
{
Expand All @@ -80,6 +79,9 @@ describe('VersionMigrationComponent', () => {
],
});

loadAspectModelService = TestBed.inject(LoadAspectModelService);
loadAspectModelService.loadExternalModels = jest.fn(() => of([]));

modelApiService = TestBed.inject(ModelApiService);
modelApiService.getNamespacesStructure = jest.fn(() => of([]));

Expand Down

0 comments on commit ac214dc

Please sign in to comment.