From f94d8a9f51b41d57aa5f543c9dda97325b126f67 Mon Sep 17 00:00:00 2001 From: Henry Taeschner Date: Mon, 25 Nov 2024 09:41:44 +0100 Subject: [PATCH] fix: added shared module test --- src/app/shared/shared.module.spec.ts | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/app/shared/shared.module.spec.ts diff --git a/src/app/shared/shared.module.spec.ts b/src/app/shared/shared.module.spec.ts new file mode 100644 index 0000000..2d73598 --- /dev/null +++ b/src/app/shared/shared.module.spec.ts @@ -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') + }) +})