diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 8fc5ec96fa00..899a0ead4532 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,7 @@ _Released 02/14/2023 (PENDING)_ - Fixed an issue with the Cloud project selection modal not showing the correct prompts. Fixes [#25520](https://github.com/cypress-io/cypress/issues/25520). - Fixed an issue in middleware where error-handling code could itself generate an error and fail to report the original issue. Fixes [#22825](https://github.com/cypress-io/cypress/issues/22825). +- Fixed an issue that could cause the Debug page to display a different number of specs for in-progress runs than shown in Cypress Cloud. Fixes [#25647](https://github.com/cypress-io/cypress/issues/25647). **Features:** diff --git a/packages/app/src/debug/DebugContainer.cy.tsx b/packages/app/src/debug/DebugContainer.cy.tsx index 0a995496efe8..797b029faad5 100644 --- a/packages/app/src/debug/DebugContainer.cy.tsx +++ b/packages/app/src/debug/DebugContainer.cy.tsx @@ -241,6 +241,8 @@ describe('', () => { result.currentProject.cloudProject.runByNumber = { ...CloudRunStubs.running, runNumber: 1, + completedInstanceCount: 2, + totalInstanceCount: 3, } as typeof test } }, @@ -255,6 +257,51 @@ describe('', () => { }) }) + it('does not render DebugPendingRunSplash and DebugNewRelevantRunBar at the same time', () => { + cy.mountFragment(DebugSpecsFragmentDoc, { + variableTypes: DebugSpecVariableTypes, + variables: { + hasNextRun: false, + runNumber: 1, + nextRunNumber: -1, + }, + onResult: (result) => { + if (result.currentProject?.cloudProject?.__typename === 'CloudProject') { + const test = result.currentProject.cloudProject.runByNumber + + // Testing this to confirm we are "making impossible states impossible" in the UI, + // and document the expectation in this scenario. For clarity, + // we do not expect a 'RUNNING` current and next run at the same time, so + // the data below represents an invalid state. + + result.currentProject.cloudProject.runByNumber = { + ...CloudRunStubs.running, + runNumber: 1, + completedInstanceCount: 2, + totalInstanceCount: 3, + } as typeof test + + result.currentProject.cloudProject.nextRun = { + ...CloudRunStubs.running, + runNumber: 1, + completedInstanceCount: 5, + totalInstanceCount: 6, + } as typeof test + } + }, + render: (gqlVal) => , + }) + + cy.findByTestId('debug-header').should('be.visible') + cy.findByTestId('debug-pending-splash') + .should('be.visible') + .within(() => { + cy.findByTestId('debug-pending-counts').should('have.text', '0 of 0 specs completed') + }) + + cy.findByTestId('newer-relevant-run').should('not.exist') + }) + it('renders specs and tests when completed run available', () => { cy.mountFragment(DebugSpecsFragmentDoc, { variableTypes: DebugSpecVariableTypes, diff --git a/packages/app/src/debug/DebugContainer.vue b/packages/app/src/debug/DebugContainer.vue index 6c5371a005da..01cbacbdc756 100644 --- a/packages/app/src/debug/DebugContainer.vue +++ b/packages/app/src/debug/DebugContainer.vue @@ -28,15 +28,15 @@ :gql="run" :commits-ahead="props.commitsAhead" /> - - + +