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

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

Signed-off-by: xuelichao <xuel@vmware.com>
This commit is contained in:
Lichao Xue 2024-06-03 19:45:02 +08:00 committed by GitHub
parent 2b271701b0
commit 81fcc0a4eb
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();