diff options
Diffstat (limited to 'portal-FE-common/src')
4 files changed, 64 insertions, 14 deletions
diff --git a/portal-FE-common/src/app/layout/components/footer/footer.component.html b/portal-FE-common/src/app/layout/components/footer/footer.component.html index 6caf2dd8..47a53cda 100644 --- a/portal-FE-common/src/app/layout/components/footer/footer.component.html +++ b/portal-FE-common/src/app/layout/components/footer/footer.component.html @@ -41,6 +41,8 @@ <a class="footer-link" href="{{footerLink}}" target="_blank"> {{footerLinkText}}</a> {{footerMessage}} {{brandName}} Version: {{buildVersion}} - <h2 style="color:white; text-align: center;" class="logo-title"> <img src="{{footerLogoImagePath}}"> {{footerLogoText}}</h2> + <h2 style="color:white; text-align: center;" class="logo-title"> + <img *ngIf="(footerLogoImagePath !='')" src="{{footerLogoImagePath}}"> {{footerLogoText}} + </h2> </div> </footer>
\ No newline at end of file diff --git a/portal-FE-common/src/app/layout/components/footer/footer.component.ts b/portal-FE-common/src/app/layout/components/footer/footer.component.ts index 9d7559ea..422a673f 100644 --- a/portal-FE-common/src/app/layout/components/footer/footer.component.ts +++ b/portal-FE-common/src/app/layout/components/footer/footer.component.ts @@ -69,7 +69,6 @@ export class FooterComponent implements OnInit { this.footerLink = this.api.footerLink; this.footerLinkText = this.api.footerLinkText; this.footerMessage= this.api.footerMessage; - this.footerLogoImagePath = "assets/images/global.logo" if(this.api.footerLogoImagePath !=''){ this.footerLogoImagePath= this.api.footerLogoImagePath; } diff --git a/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts index e0df154d..1ecba2c2 100644 --- a/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts +++ b/portal-FE-common/src/app/pages/widget-onboarding/widget-onboarding.component.spec.ts @@ -42,17 +42,59 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { FormsModule } from '@angular/forms'; import { NgMaterialModule } from 'src/app/ng-material-module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { WidgetOnboardingService } from 'src/app/shared/services/widget-onboarding/widget-onboarding.service'; +import { Observable } from 'rxjs'; +import { HttpClientModule } from '@angular/common/http'; describe('WidgetOnboardingComponent', () => { let component: WidgetOnboardingComponent; let fixture: ComponentFixture<WidgetOnboardingComponent>; + let widgetList = [{"id" :"1", + "name":"ONAP-A", + "desc" :"desc", + "fileLocation" : "fileLocation", + "allowAllUser" : "allowAllUser", + "serviceId" : "serviceId", + "serviceURL" : "serviceURL", + "sortOrder" : "sortOrder", + "statusCode" : "statusCode", + "widgetRoles": "widgetRoles", + "appContent" : "appContent", + "appName" : "appName", + "file" : "file", + "allUser": false, + "saving": "saving"},{"id" :"1", + "name":"ONAP-B", + "desc" :"desc", + "fileLocation" : "fileLocation", + "allowAllUser" : "allowAllUser", + "serviceId" : "serviceId", + "serviceURL" : "serviceURL", + "sortOrder" : "sortOrder", + "statusCode" : "statusCode", + "widgetRoles": "widgetRoles", + "appContent" : "appContent", + "appName" : "appName", + "file" : "file", + "allUser": false, + "saving": "saving"}] + beforeEach(async(() => { + let widgetOnboardingService: WidgetOnboardingService; + + // widgetOnboardingService = jasmine.createSpyObj('WidgetOnboardingService', ['getManagedWidgets']); + //widgetOnboardingService.getManagedWidgets.and.returnValue(Observable.of(widgetList)); TestBed.configureTestingModule({ declarations: [ WidgetOnboardingComponent ], - imports:[HttpClientTestingModule,FormsModule,NgMaterialModule,BrowserAnimationsModule], + imports:[HttpClientModule,FormsModule,NgMaterialModule,BrowserAnimationsModule], + providers:[WidgetOnboardingService] }) .compileComponents(); + + + widgetOnboardingService = TestBed.get(WidgetOnboardingService); + spyOn(widgetOnboardingService, 'getManagedWidgets').and.returnValue(Observable.of(widgetList)); })); beforeEach(() => { @@ -61,7 +103,14 @@ describe('WidgetOnboardingComponent', () => { fixture.detectChanges(); }); + + it('should create', () => { expect(component).toBeTruthy(); }); + it('getOnboardingWidgets should return stubbed value', () => { + spyOn(component, 'getOnboardingWidgets').and.callThrough(); + component.getOnboardingWidgets(); + expect(component.getOnboardingWidgets).toHaveBeenCalledWith(); + }); }); diff --git a/portal-FE-common/src/app/shared/model/widget-onboarding/widget.ts b/portal-FE-common/src/app/shared/model/widget-onboarding/widget.ts index ba1842f5..930d5984 100644 --- a/portal-FE-common/src/app/shared/model/widget-onboarding/widget.ts +++ b/portal-FE-common/src/app/shared/model/widget-onboarding/widget.ts @@ -5,29 +5,29 @@ * Copyright © 2019 AT&T Intellectual Property. All rights reserved. * =================================================================== * - * Unless otherwise specified?: any; all software contained herein is licensed - * under the Apache License?: any; Version 2.0 (the "License"); + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing?: any; software - * distributed under the License is distributed on an "AS IS" BASIS?: any; - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND?: any; either express or implied. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * - * Unless otherwise specified?: any; all documentation contained herein is licensed - * under the Creative Commons License?: any; Attribution 4.0 Intl. (the "License"); + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); * you may not use this documentation except in compliance with the License. * You may obtain a copy of the License at * * https://creativecommons.org/licenses/by/4.0/ * - * Unless required by applicable law or agreed to in writing?: any; documentation - * distributed under the License is distributed on an "AS IS" BASIS?: any; - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND?: any; either express or implied. + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @@ -51,4 +51,4 @@ export interface IWidget { file ?: any; allUser ?: boolean; saving ?: any -}
\ No newline at end of file +} |