From 3712f05846d5fe632031049ff22ab76f00814395 Mon Sep 17 00:00:00 2001 From: Christian Badura Date: Mon, 8 Apr 2024 10:11:10 +0200 Subject: [PATCH 1/2] feat: change technology field to dropdown --- .../app-detail/app-detail.component.html | 12 ++++++------ .../product-store/app-detail/app-detail.component.ts | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/product-store/app-detail/app-detail.component.html b/src/app/product-store/app-detail/app-detail.component.html index bab76de..66f3b1e 100644 --- a/src/app/product-store/app-detail/app-detail.component.html +++ b/src/app/product-store/app-detail/app-detail.component.html @@ -51,16 +51,16 @@
- + [options]="technologies" + > + diff --git a/src/app/product-store/app-detail/app-detail.component.ts b/src/app/product-store/app-detail/app-detail.component.ts index bac5165..133e340 100644 --- a/src/app/product-store/app-detail/app-detail.component.ts +++ b/src/app/product-store/app-detail/app-detail.component.ts @@ -64,6 +64,10 @@ export class AppDetailComponent implements OnChanges { public loading = false public hasCreatePermission = false public hasEditPermission = false + public technologies: SelectItem[] = [ + { label: 'Angular', value: 'ANGULAR' }, + { label: 'WebComponent', value: 'WEBCOMPONENT' } + ] public iconItems: SelectItem[] = [{ label: '', value: null }] // default value is empty public convertToUniqueStringArray = convertToUniqueStringArray From 2a618fe3613d99c33117e9e068d5e08a121bd401 Mon Sep 17 00:00:00 2001 From: Christian Badura Date: Mon, 8 Apr 2024 10:32:03 +0200 Subject: [PATCH 2/2] feat: increase test coverage in image container --- .../image-container.component.spec.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/shared/image-container/image-container.component.spec.ts b/src/app/shared/image-container/image-container.component.spec.ts index 8c61e78..668e68d 100644 --- a/src/app/shared/image-container/image-container.component.spec.ts +++ b/src/app/shared/image-container/image-container.component.spec.ts @@ -2,13 +2,26 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing' import { ImageContainerComponent } from './image-container.component' import { prepareUrl } from 'src/app/shared/utils' +import { AppStateService } from '@onecx/portal-integration-angular' +import { of } from 'rxjs' + +class MockAppStateService { + currentMfe$ = of({ + remoteBaseUrl: '/base/' + }) +} + describe('ImageContainerComponent', () => { let component: ImageContainerComponent let fixture: ComponentFixture + let mockAppStateService: MockAppStateService beforeEach(waitForAsync(() => { + mockAppStateService = new MockAppStateService() + TestBed.configureTestingModule({ - declarations: [ImageContainerComponent] + declarations: [ImageContainerComponent], + providers: [{ provide: AppStateService, useValue: mockAppStateService }] }).compileComponents() })) @@ -20,6 +33,7 @@ describe('ImageContainerComponent', () => { it('should create', () => { expect(component).toBeTruthy() + expect(component.defaultImageUrl).toEqual('/base/./assets/images/product.jpg') }) describe('ngOnChanges', () => {