From c3c8b3471e7b1cbae3bb7809ac7773cd28eaf13d Mon Sep 17 00:00:00 2001 From: Christian Badura Date: Wed, 21 Feb 2024 11:38:28 +0100 Subject: [PATCH] fix: use absolute paths in spec files --- src/app/services/menu-state.service.spec.ts | 2 +- src/app/services/menu-tree.service.spec.ts | 4 +-- .../workspace-create.component.spec.ts | 4 +-- .../menu/menu.component.spec.ts | 8 +++--- .../workspace-contact.component.spec.ts | 4 +-- .../workspace-detail.component.spec.ts | 10 +++---- .../workspace-intern.component.spec.ts | 27 ++++++++++--------- .../workspace-props.component.spec.ts | 4 +-- .../workspace-roles.component.spec.ts | 4 +-- .../confirm/confirm.component.spec.ts | 4 +-- .../preview/preview.component.spec.ts | 4 +-- .../workspace-import.component.spec.ts | 8 +++--- .../workspace-search.component.spec.ts | 4 +-- 13 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/app/services/menu-state.service.spec.ts b/src/app/services/menu-state.service.spec.ts index 88066b38..39a4b1d1 100644 --- a/src/app/services/menu-state.service.spec.ts +++ b/src/app/services/menu-state.service.spec.ts @@ -1,7 +1,7 @@ import { TestBed } from '@angular/core/testing' import { HttpClientTestingModule } from '@angular/common/http/testing' -import { MenuStateService } from './menu-state.service' +import { MenuStateService } from 'src/app/services/menu-state.service' describe('MenuStateService', () => { let service: MenuStateService diff --git a/src/app/services/menu-tree.service.spec.ts b/src/app/services/menu-tree.service.spec.ts index 12d021c2..e8000876 100644 --- a/src/app/services/menu-tree.service.spec.ts +++ b/src/app/services/menu-tree.service.spec.ts @@ -2,8 +2,8 @@ import { TestBed } from '@angular/core/testing' import { HttpClientTestingModule } from '@angular/common/http/testing' import { TreeNode } from 'primeng/api' -import { MenuTreeService } from './menu-tree.service' -import { MenuItem } from '../shared/generated' +import { MenuTreeService } from 'src/app/services/menu-tree.service' +import { MenuItem } from 'src/app/shared/generated' describe('MenuTreeService', () => { let service: MenuTreeService diff --git a/src/app/workspace/workspace-create/workspace-create.component.spec.ts b/src/app/workspace/workspace-create/workspace-create.component.spec.ts index 23559af8..1fd1a277 100644 --- a/src/app/workspace/workspace-create/workspace-create.component.spec.ts +++ b/src/app/workspace/workspace-create/workspace-create.component.spec.ts @@ -10,9 +10,9 @@ import { NO_ERRORS_SCHEMA } from '@angular/core' import { ConfirmationService, MessageService } from 'primeng/api' import { DropdownModule } from 'primeng/dropdown' -import { environment } from '../../../environments/environment' +import { environment } from 'src/environments/environment' import { APP_CONFIG, AppStateService, createTranslateLoader } from '@onecx/portal-integration-angular' -// import { PortalInternalAPIService } from '../../generated' +// import { PortalInternalAPIService } from 'src/app/generated' describe('WorkspaceCreateComponent', () => { let component: WorkspaceCreateComponent diff --git a/src/app/workspace/workspace-detail/menu/menu.component.spec.ts b/src/app/workspace/workspace-detail/menu/menu.component.spec.ts index 86090f4c..846b8570 100644 --- a/src/app/workspace/workspace-detail/menu/menu.component.spec.ts +++ b/src/app/workspace/workspace-detail/menu/menu.component.spec.ts @@ -6,16 +6,14 @@ import { Location } from '@angular/common' import { HttpClientTestingModule } from '@angular/common/http/testing' import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router' // import { TranslateLoader, TranslateModule } from '@ngx-translate/core' -// import { TranslateLoader, TranslateModule } from '@ngx-translate/core' import { of, throwError } from 'rxjs' import { PortalMessageService, ConfigurationService, AUTH_SERVICE } from '@onecx/portal-integration-angular' -// import { HttpLoaderFactory } from 'src/app/shared/shared.module' -// import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { MenuComponent } from './menu.component' + +import { MenuComponent } from 'src/app/workspace/workspace-detail/menu/menu.component' import { MenuStateService, MenuState } from 'src/app/services/menu-state.service' -import { Workspace, MenuItem, WorkspaceAPIService, Scope, MenuItemAPIService } from '../../../shared/generated' +import { Workspace, MenuItem, WorkspaceAPIService, Scope, MenuItemAPIService } from 'src/app/shared/generated' import FileSaver from 'file-saver' const workspace: Workspace = { diff --git a/src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component.spec.ts b/src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component.spec.ts index f7006531..85d28ec0 100644 --- a/src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component.spec.ts +++ b/src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component.spec.ts @@ -6,8 +6,8 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core' import { FormControl, FormGroup } from '@angular/forms' import { AppStateService, createTranslateLoader, PortalMessageService } from '@onecx/portal-integration-angular' -import { WorkspaceContactComponent } from './workspace-contact.component' -import { Workspace } from '../../../shared/generated' +import { WorkspaceContactComponent } from 'src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component' +import { Workspace } from 'src/app/shared/generated' const portal: Workspace = { name: 'name', diff --git a/src/app/workspace/workspace-detail/workspace-detail.component.spec.ts b/src/app/workspace/workspace-detail/workspace-detail.component.spec.ts index 20f8cfb2..100af549 100644 --- a/src/app/workspace/workspace-detail/workspace-detail.component.spec.ts +++ b/src/app/workspace/workspace-detail/workspace-detail.component.spec.ts @@ -17,12 +17,12 @@ import { createTranslateLoader, PortalMessageService } from '@onecx/portal-integration-angular' -import { WorkspaceDetailComponent } from './workspace-detail.component' -import { WorkspaceContactComponent } from './workspace-contact/workspace-contact.component' -import { WorkspacePropsComponent } from './workspace-props/workspace-props.component' -import { WorkspaceRolesComponent } from './workspace-roles/workspace-roles.component' +import { WorkspaceDetailComponent } from 'src/app/workspace/workspace-detail/workspace-detail.component' +import { WorkspaceContactComponent } from 'src/app/workspace/workspace-detail/workspace-contact/workspace-contact.component' +import { WorkspacePropsComponent } from 'src/app/workspace/workspace-detail/workspace-props/workspace-props.component' +import { WorkspaceRolesComponent } from 'src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component' // import { WorkspaceImagesComponent } from './workspace-images/workspace-images.component' -import { Workspace, MenuItem, WorkspaceAPIService, MenuItemAPIService } from '../../shared/generated' +import { Workspace, MenuItem, WorkspaceAPIService, MenuItemAPIService } from 'src/app/shared/generated' class MockRouter { navigate = jasmine.createSpy('navigate') diff --git a/src/app/workspace/workspace-detail/workspace-intern/workspace-intern.component.spec.ts b/src/app/workspace/workspace-detail/workspace-intern/workspace-intern.component.spec.ts index bfaebb16..85b64103 100644 --- a/src/app/workspace/workspace-detail/workspace-intern/workspace-intern.component.spec.ts +++ b/src/app/workspace/workspace-detail/workspace-intern/workspace-intern.component.spec.ts @@ -1,11 +1,11 @@ import { NO_ERRORS_SCHEMA } from '@angular/core' import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing' -// import { HttpClient } from '@angular/common/http' +import { HttpClient } from '@angular/common/http' import { HttpClientTestingModule } from '@angular/common/http/testing' -// import { TranslateLoader, TranslateModule } from '@ngx-translate/core' +import { TranslateLoader, TranslateModule } from '@ngx-translate/core' -// import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { WorkspaceInternComponent } from './workspace-intern.component' +import { AppStateService, createTranslateLoader } from '@onecx/portal-integration-angular' +import { WorkspaceInternComponent } from 'src/app/workspace/workspace-detail/workspace-intern/workspace-intern.component' describe('WorkspaceInternComponent', () => { let component: WorkspaceInternComponent @@ -15,14 +15,15 @@ describe('WorkspaceInternComponent', () => { TestBed.configureTestingModule({ declarations: [WorkspaceInternComponent], imports: [ - HttpClientTestingModule - // TranslateModule.forRoot({ - // loader: { - // provide: TranslateLoader, - // useFactory: HttpLoaderFactory, - // deps: [HttpClient] - // } - // }) + HttpClientTestingModule, + TranslateModule.forRoot({ + isolate: true, + loader: { + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [HttpClient, AppStateService] + } + }) ], schemas: [NO_ERRORS_SCHEMA] }).compileComponents() @@ -41,7 +42,7 @@ describe('WorkspaceInternComponent', () => { fixture.detectChanges() }) - it('should create', () => { + fit('should create', () => { expect(component).toBeTruthy() }) }) diff --git a/src/app/workspace/workspace-detail/workspace-props/workspace-props.component.spec.ts b/src/app/workspace/workspace-detail/workspace-props/workspace-props.component.spec.ts index 5fcff832..a5c4716c 100644 --- a/src/app/workspace/workspace-detail/workspace-props/workspace-props.component.spec.ts +++ b/src/app/workspace/workspace-detail/workspace-props/workspace-props.component.spec.ts @@ -13,8 +13,8 @@ import { ThemeService } from '@onecx/portal-integration-angular' // import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { WorkspacePropsComponent } from './workspace-props.component' -import { WorkspaceAPIService } from '../../../shared/generated' +import { WorkspacePropsComponent } from 'src/app/workspace/workspace-detail/workspace-props/workspace-props.component' +import { WorkspaceAPIService } from 'src/app/shared/generated' const workspaceDetail = { name: 'name', diff --git a/src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component.spec.ts b/src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component.spec.ts index 5aa2ae9f..51b04c3f 100644 --- a/src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component.spec.ts +++ b/src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component.spec.ts @@ -6,8 +6,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing' import { TranslateLoader, TranslateModule } from '@ngx-translate/core' import { AppStateService, createTranslateLoader, PortalMessageService } from '@onecx/portal-integration-angular' -import { WorkspaceRolesComponent } from './workspace-roles.component' -import { Workspace } from '../../../shared/generated' +import { WorkspaceRolesComponent } from 'src/app/workspace/workspace-detail/workspace-roles/workspace-roles.component' +import { Workspace } from 'src/app/shared/generated' const portal: Workspace = { name: 'name', diff --git a/src/app/workspace/workspace-import/confirm/confirm.component.spec.ts b/src/app/workspace/workspace-import/confirm/confirm.component.spec.ts index 598af0cf..0d7e398a 100644 --- a/src/app/workspace/workspace-import/confirm/confirm.component.spec.ts +++ b/src/app/workspace/workspace-import/confirm/confirm.component.spec.ts @@ -6,8 +6,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing' import { of } from 'rxjs' // import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { ConfirmComponent } from './confirm.component' -import { WorkspaceAPIService } from '../../../shared/generated' +import { ConfirmComponent } from 'src/app/workspace/workspace-import/confirm/confirm.component' +import { WorkspaceAPIService } from 'src/app/shared/generated' const workspace = { workspaceName: 'name', diff --git a/src/app/workspace/workspace-import/preview/preview.component.spec.ts b/src/app/workspace/workspace-import/preview/preview.component.spec.ts index b2da48da..5a4d061f 100644 --- a/src/app/workspace/workspace-import/preview/preview.component.spec.ts +++ b/src/app/workspace/workspace-import/preview/preview.component.spec.ts @@ -6,8 +6,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing' import { of } from 'rxjs' // import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { PreviewComponent } from './preview.component' -import { WorkspaceSnapshot } from '../../../shared/generated' +import { PreviewComponent } from 'src/app/workspace/workspace-import/preview/preview.component' +import { WorkspaceSnapshot } from 'src/app/shared/generated' const snapshot: WorkspaceSnapshot = { workspaces: { diff --git a/src/app/workspace/workspace-import/workspace-import.component.spec.ts b/src/app/workspace/workspace-import/workspace-import.component.spec.ts index 70f257ee..a6f92d25 100644 --- a/src/app/workspace/workspace-import/workspace-import.component.spec.ts +++ b/src/app/workspace/workspace-import/workspace-import.component.spec.ts @@ -9,10 +9,10 @@ import { of, throwError } from 'rxjs' import { AUTH_SERVICE, PortalMessageService } from '@onecx/portal-integration-angular' // import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { WorkspaceImportComponent } from './workspace-import.component' -import { ConfirmComponent } from './confirm/confirm.component' -import { WorkspaceAPIService, EximWorkspaceMenuItem, WorkspaceSnapshot } from '../../shared/generated' -import { PreviewComponent } from './preview/preview.component' +import { WorkspaceImportComponent } from 'src/app/workspace/workspace-import/workspace-import.component' +import { ConfirmComponent } from 'src/app/workspace/workspace-import/confirm/confirm.component' +import { WorkspaceAPIService, EximWorkspaceMenuItem, WorkspaceSnapshot } from 'src/app/shared/generated' +import { PreviewComponent } from 'src/app/workspace/workspace-import/preview/preview.component' class MockRouter { navigate = jasmine.createSpy('navigate') diff --git a/src/app/workspace/workspace-search/workspace-search.component.spec.ts b/src/app/workspace/workspace-search/workspace-search.component.spec.ts index 973ccb00..10ef5802 100644 --- a/src/app/workspace/workspace-search/workspace-search.component.spec.ts +++ b/src/app/workspace/workspace-search/workspace-search.component.spec.ts @@ -9,8 +9,8 @@ import { of, throwError } from 'rxjs' import { PortalMessageService } from '@onecx/portal-integration-angular' // import { HttpLoaderFactory } from 'src/app/shared/shared.module' -import { WorkspaceSearchComponent } from './workspace-search.component' -import { Workspace, WorkspaceAPIService } from '../../shared/generated' +import { WorkspaceSearchComponent } from 'src/app/workspace/workspace-search/workspace-search.component' +import { Workspace, WorkspaceAPIService } from 'src/app/shared/generated' class MockRouter { navigate = jasmine.createSpy('navigate')