Skip to content

Commit

Permalink
fix: use absolute paths in spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Badura committed Feb 21, 2024
1 parent 1344724 commit c3c8b34
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/app/services/menu-state.service.spec.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/menu-tree.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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()
Expand All @@ -41,7 +42,7 @@ describe('WorkspaceInternComponent', () => {
fixture.detectChanges()
})

it('should create', () => {
fit('should create', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit c3c8b34

Please sign in to comment.