diff --git a/cypress/integration/directory.spec.js b/cypress/integration/directory.spec.js --- a/cypress/integration/directory.spec.js +++ b/cypress/integration/directory.spec.js @@ -72,4 +72,12 @@ cy.get('.swh-directory-table') .should('be.visible'); }); + + it('should have metadata available from javascript', function() { + cy.window().then(win => { + const metadata = win.swh.webapp.getBrowsedSwhObjectMetadata(); + expect(metadata).to.not.be.empty; + expect(metadata).to.have.any.keys('directory'); + }); + }); }); diff --git a/swh/web/templates/includes/show-metadata.html b/swh/web/templates/includes/show-metadata.html --- a/swh/web/templates/includes/show-metadata.html +++ b/swh/web/templates/includes/show-metadata.html @@ -7,30 +7,32 @@ {% load swh_templatetags %} - +{% if user.is_staff %} + -