diff --git a/cypress/e2e/hub/collections-detail-install.cy.ts b/cypress/e2e/hub/collections-detail-install.cy.ts
index 9bf9e80226..e62d08b58f 100644
--- a/cypress/e2e/hub/collections-detail-install.cy.ts
+++ b/cypress/e2e/hub/collections-detail-install.cy.ts
@@ -1,7 +1,6 @@
import { randomE2Ename } from '../../support/utils';
import { Collections } from './constants';
-// cypress
describe('collections-detail-install', () => {
let collectionName: string = '';
let namespaceName: string = '';
@@ -15,7 +14,7 @@ describe('collections-detail-install', () => {
cy.getByDataCy('collection-install-tab').click();
}
- beforeEach(() => {
+ before(() => {
namespaceName = randomE2Ename();
collectionName = randomE2Ename();
@@ -24,6 +23,11 @@ describe('collections-detail-install', () => {
});
});
+ after(() => {
+ cy.deleteHubCollectionByName(collectionName);
+ cy.deleteHubNamespace({ name: namespaceName, failOnStatusCode: false });
+ });
+
it('can download tarball', () => {
goToInstallTab();
@@ -51,11 +55,8 @@ describe('collections-detail-install', () => {
// for now we test button is rendered
cy.contains('button', 'Download tarball');
- cy.contains('button', 'Show signature').click();
- //cy.contains('BEGIN PGP SIGNATURE');
- });
-
- afterEach(() => {
- cy.deleteHubCollectionByName(collectionName);
+ // FIXME: sign collection first
+ // cy.contains('button', 'Show signature').click();
+ // cy.contains('BEGIN PGP SIGNATURE');
});
});
diff --git a/frontend/hub/collections/CollectionPage/CollectionInstall.tsx b/frontend/hub/collections/CollectionPage/CollectionInstall.tsx
index 969edd63c5..624df2be53 100644
--- a/frontend/hub/collections/CollectionPage/CollectionInstall.tsx
+++ b/frontend/hub/collections/CollectionPage/CollectionInstall.tsx
@@ -45,7 +45,7 @@ export function CollectionInstall() {
const content = contentResults?.results[0];
- if ((!basePath && !error) || (!content && !contentError)) {
+ if ((!basePath && !error) || (!content && !contentError) || !collection) {
return ;
}
@@ -141,22 +141,18 @@ export function CollectionInstall() {
-
- }
- onClick={() => {
- if (!showSignature) {
- setShowSignature(true);
- } else {
- setShowSignature(false);
- }
- }}
- >
- {showSignature ? t(`Hide signature`) : t(`Show signature`)}
-
- {showSignature && }
-
+ {collection?.is_signed ? (
+
+ }
+ onClick={() => setShowSignature(!showSignature)}
+ >
+ {showSignature ? t(`Hide signature`) : t(`Show signature`)}
+
+ {showSignature && }
+
+ ) : null}
{collection?.collection_version?.requires_ansible &&