Skip to content

Commit

Permalink
MARP-1642 Application Freezing due to missing product detail content (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy authored Dec 13, 2024
1 parent d89c12a commit 4439b5d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h4 class="analysis-title text-primary text-capitalize mb-0">
[id]="displayedTab.value"
role="tabpanel"
[attr.aria-labelledby]="displayedTab.value + '-tab'">
@if (displayedTab.value === 'dependency') {
@if (displayedTab.value === 'dependency' && productDetail().productModuleContent) {
<app-product-detail-maven-content
[productDetail]="productDetail()"
[selectedVersion]="selectedVersion">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,4 +808,20 @@ describe('ProductDetailComponent', () => {
expect(rateConnector.childNodes[0].nativeNode.textContent).toContain("common.feedback.rateFeedbackForUtilityBtnLabel");
expect(rateConnectorEmptyText.childNodes[0].nativeNode.textContent).toContain("common.feedback.noFeedbackForUtilityLabel");
});

it('maven tab should not display when product module content is missing', () => {
const event = { value: 'dependency' };
component.onTabChange(event.value);
fixture.detectChanges();
let mavenTab = fixture.debugElement.query(
By.css('app-product-detail-maven-content')
);
expect(mavenTab).toBeTruthy();
component.productModuleContent.set({} as any as ProductModuleContent);
fixture.detectChanges();
mavenTab = fixture.debugElement.query(
By.css('app-product-detail-maven-content')
);
expect(mavenTab).toBeFalsy();
});
});

0 comments on commit 4439b5d

Please sign in to comment.