From 10ff24450274a8793bbd35a2d4d2d439f938f8bf Mon Sep 17 00:00:00 2001 From: ruizajtruss Date: Fri, 16 Feb 2024 01:44:04 +0000 Subject: [PATCH] cypress fixes --- .../src/pages/SubmissionSideNav/SubmissionSideNav.tsx | 3 ++- services/cypress/support/navigateCommands.ts | 11 +---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx b/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx index 777e54c4ca..683174afa3 100644 --- a/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx +++ b/services/app-web/src/pages/SubmissionSideNav/SubmissionSideNav.tsx @@ -201,7 +201,8 @@ export const SubmissionSideNav = () => { : 'SUBMISSIONS_SUMMARY' )} > - {isStateUser + {isStateUser && + submissionStatus === 'UNLOCKED' ? 'Submission' : 'Submission summary'} , diff --git a/services/cypress/support/navigateCommands.ts b/services/cypress/support/navigateCommands.ts index d6023ccc05..9f5e5b5dcb 100644 --- a/services/cypress/support/navigateCommands.ts +++ b/services/cypress/support/navigateCommands.ts @@ -1,5 +1,3 @@ -import { aliasQuery, aliasMutation } from '../utils/graphql-test-utils' - type FormButtonKey = | 'CONTINUE_FROM_START_NEW' | 'CONTINUE' @@ -13,8 +11,6 @@ const buttonsWithLabels: FormButtons = { BACK: 'Back', } -const isSubmissionEditUrl = /submissions\/([0-9a-fA-F-]+)\/edit/ - Cypress.Commands.add( 'navigateFormByButtonClick', (buttonKey: FormButtonKey, waitForLoad = true) => { @@ -35,7 +31,6 @@ Cypress.Commands.add( if (waitForLoad) { cy.wait('@createHealthPlanPackageMutation', { timeout: 50_000 }) cy.wait('@fetchHealthPlanPackageWithQuestionsQuery') - cy.wait('@fetchHealthPlanPackageQuery') } cy.findByTestId('state-submission-form-page').should('exist') } else if (buttonKey === 'CONTINUE') { @@ -55,11 +50,7 @@ Cypress.Commands.add( (url: string, waitForLoad = true) => { cy.visit(url) if (waitForLoad) { - if(isSubmissionEditUrl.test(url)) { - cy.wait('@fetchHealthPlanPackageQuery', { timeout: 50_000 }) - } else { - cy.wait('@fetchHealthPlanPackageWithQuestionsQuery', { timeout: 50_000 }) - } + cy.wait('@fetchHealthPlanPackageWithQuestionsQuery', { timeout: 50_000 }) } } )