Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change technology field to dropdown, increase test coverage img container #97

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/app/product-store/app-detail/app-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@
</div>
<div class="col-12 md:col-6" style="min-width: 15rem" [title]="'APP.TOOLTIPS.TECHNOLOGY' | translate">
<span class="p-float-label" controlErrorAnchor>
<input
pInputText
type="text"
<p-dropdown
id="app_detail_form_mfe_technology"
class="w-full pt-3 pb-2"
formControlName="exposedModule"
styleClass="w-full min-w-min input-field-correction"
formControlName="technology"
[pTooltip]="'APP.TOOLTIPS.TECHNOLOGY' | translate"
tooltipPosition="top"
tooltipEvent="focus"
/>
[options]="technologies"
>
</p-dropdown>
<label class="ocx-required-label" for="app_detail_form_mfe_technology">
{{ 'APP.TECHNOLOGY' | translate }}
</label>
Expand Down
4 changes: 4 additions & 0 deletions src/app/product-store/app-detail/app-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion src/app/shared/image-container/image-container.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ImageContainerComponent>
let mockAppStateService: MockAppStateService

beforeEach(waitForAsync(() => {
mockAppStateService = new MockAppStateService()

TestBed.configureTestingModule({
declarations: [ImageContainerComponent]
declarations: [ImageContainerComponent],
providers: [{ provide: AppStateService, useValue: mockAppStateService }]
}).compileComponents()
}))

Expand All @@ -20,6 +33,7 @@ describe('ImageContainerComponent', () => {

it('should create', () => {
expect(component).toBeTruthy()
expect(component.defaultImageUrl).toEqual('/base/./assets/images/product.jpg')
})

describe('ngOnChanges', () => {
Expand Down
Loading