Fixes-20537 SBOM tab should not exist when the artifact is helm package (#20538)

Fixes-20537 SBOM tab should not exist when the artifact is oci-compliant helm-chart

Signed-off-by: xuelichao <xuel@vmware.com>
This commit is contained in:
Lichao Xue 2024-06-03 19:44:38 +08:00 committed by GitHub
parent 74f4a358f8
commit 115827cac7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -59,7 +59,10 @@ export class ArtifactAdditionsComponent implements AfterViewChecked, OnInit {
}
hasScannerSupportSBOM(): boolean {
return this.artifactListPageService.hasScannerSupportSBOM();
if (this.additionLinks && this.additionLinks[ADDITIONS.SBOMS]) {
return true;
}
return false;
}
getVulnerability(): AdditionLink {

View File

@ -179,8 +179,8 @@ describe('ResultSbomComponent (inline template)', () => {
component.artifactDigest = mockedSbomDigest;
component.sbomDigest = mockedSbomDigest;
component.accessories = mockedAccessories;
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
const el: HTMLElement =
fixture.nativeElement.querySelector('.tip-block');
expect(el).not.toBeNull();