Skip to content

Commit

Permalink
fix: added shared module test
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Nov 25, 2024
1 parent 8f10d0e commit f94d8a9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/app/shared/shared.module.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NO_ERRORS_SCHEMA } from '@angular/core'
import { TestBed } from '@angular/core/testing'
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'

import { MfeInfo } from '@onecx/portal-integration-angular'

import { environment } from 'src/environments/environment'

describe('SharedModule', () => {
beforeEach(() => {
TestBed.configureTestingModule({
schemas: [NO_ERRORS_SCHEMA],
providers: [provideHttpClient(), provideHttpClientTesting()]
})
})

// TODO: correct this and do the right thing
it('should return the correct basePath with mfeInfo', () => {
const mfeInfo: MfeInfo = {
mountPath: '',
remoteBaseUrl: 'http://localhost:4200/',
baseHref: '',
shellName: '',
appId: '',
productName: ''
}
const result = mfeInfo.remoteBaseUrl + '' + environment.apiPrefix
expect(result).toEqual('http://localhost:4200/bff')
})
})

0 comments on commit f94d8a9

Please sign in to comment.