-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christian Badura
committed
Jan 18, 2024
1 parent
d438a54
commit 2b029e1
Showing
4 changed files
with
115 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { NO_ERRORS_SCHEMA } from '@angular/core' | ||
import { TestBed } from '@angular/core/testing' | ||
import { HttpClient } from '@angular/common/http' | ||
import { HttpClientTestingModule } from '@angular/common/http/testing' | ||
|
||
import { MfeInfo, TranslateCombinedLoader } from '@onecx/portal-integration-angular' | ||
import { basePathProvider, HttpLoaderFactory } from './shared.module' | ||
|
||
describe('SharedModule', () => { | ||
let httpClient: HttpClient | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
schemas: [NO_ERRORS_SCHEMA] | ||
}) | ||
|
||
httpClient = TestBed.inject(HttpClient) | ||
}) | ||
|
||
it('should return the correct basePath with mfeInfo', () => { | ||
const mfeInfo: MfeInfo = { | ||
mountPath: '', | ||
remoteBaseUrl: 'http://localhost:4200/', | ||
baseHref: '', | ||
shellName: '' | ||
} | ||
|
||
const result = basePathProvider(mfeInfo) | ||
|
||
expect(result).toEqual('http://localhost:4200/product-store-bff') | ||
}) | ||
|
||
it('should return a translate loader', () => { | ||
const mfeInfo: MfeInfo = { | ||
mountPath: '', | ||
remoteBaseUrl: 'http://localhost:4200/', | ||
baseHref: '', | ||
shellName: '' | ||
} | ||
|
||
const result = HttpLoaderFactory(httpClient, mfeInfo) | ||
|
||
expect(result).toBeInstanceOf(TranslateCombinedLoader) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters