diff --git a/assets/src/bundles/add_forge/create-request.js b/assets/src/bundles/add_forge/create-request.js --- a/assets/src/bundles/add_forge/create-request.js +++ b/assets/src/bundles/add_forge/create-request.js @@ -58,15 +58,21 @@ $(window).on('hashchange', () => { if (window.location.hash === '#browse-requests') { $('.nav-tabs a[href="#swh-add-forge-requests-list"]').tab('show'); + } else if (window.location.hash === '#help') { + $('.nav-tabs a[href="#swh-add-forge-requests-help"]').tab('show'); } else { $('.nav-tabs a[href="#swh-add-forge-submit-request"]').tab('show'); } - }); + }).trigger('hashchange'); $('#swh-add-forge-requests-list-tab').on('shown.bs.tab', () => { window.location.hash = '#browse-requests'; }); + $('#swh-add-forge-requests-help-tab').on('shown.bs.tab', () => { + window.location.hash = '#help'; + }); + $('#swh-add-forge-tab').on('shown.bs.tab', () => { removeUrlFragment(); }); diff --git a/cypress/integration/add-forge-now-request-create.spec.js b/cypress/integration/add-forge-now-request-create.spec.js --- a/cypress/integration/add-forge-now-request-create.spec.js +++ b/cypress/integration/add-forge-now-request-create.spec.js @@ -19,7 +19,7 @@ this.addForgeNowUrl = this.Urls.forge_add(); }); - it('should show both tabs for every user', function() { + it('should show all the tabs for every user', function() { cy.visit(this.addForgeNowUrl); cy.get('#swh-add-forge-tab') @@ -27,6 +27,9 @@ cy.get('#swh-add-forge-requests-list-tab') .should('have.class', 'nav-link'); + + cy.get('#swh-add-forge-requests-help-tab') + .should('have.class', 'nav-link'); }); it('should show create forge tab by default', function() {