diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index c7f3ad48bd28..b10418d3b102 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -8,6 +8,7 @@ _Released 02/28/2023 (PENDING)_ - It is now possible to set `hostOnly` cookies with [`cy.setCookie()`](https://docs.cypress.io/api/commands/setcookie) for a given domain. Addresses [#16856](https://github.com/cypress-io/cypress/issues/16856) and [#17527](https://github.com/cypress-io/cypress/issues/17527). - Added a Public API for third party component libraries to define a Framework Definition, embedding their library into the Cypress onboarding workflow. Learn more [here](https://docs.cypress.io/guides/component-testing/third-party-definitions). Implemented in [#25780](https://github.com/cypress-io/cypress/pull/25780) and closes [#25638](https://github.com/cypress-io/cypress/issues/25638). - Added a Debug Page tutorial slideshow for projects that are not connected to Cypress Cloud. Addresses [#25768](https://github.com/cypress-io/cypress/issues/25768). +- Updated the "new" status badge for the Debug page navigation link to be less noticeable when the navigation is collapsed. Addresses [#25739](https://github.com/cypress-io/cypress/issues/25739). **Bugfixes:** diff --git a/packages/app/cypress/e2e/sidebar_navigation.cy.ts b/packages/app/cypress/e2e/sidebar_navigation.cy.ts index ec8432b25ec8..196bc56731e2 100644 --- a/packages/app/cypress/e2e/sidebar_navigation.cy.ts +++ b/packages/app/cypress/e2e/sidebar_navigation.cy.ts @@ -250,6 +250,34 @@ describe('Sidebar Navigation', { viewportWidth: 1280 }, () => { cy.get('.router-link-active').findByText('Debug').should('be.visible') }) + it('Debug "new" notification appears as a dot when nav is collapsed', () => { + cy.findByLabelText('New Debug feature') + .should('be.visible') + .contains('New') + + // in expanded state, expect no dot + cy.findByTestId('debug-badge-dot').should('not.exist') + + // collapse the nav + cy.findByTestId('toggle-sidebar').click() + + // in collapsed state, find the dot + // TODO (Percy): when Percy is enabled for e2e tests + // we can stop testing the class name directly here + cy.findByLabelText('New Debug feature', { + selector: '[data-cy=debug-badge-dot]', + }) + .should('be.visible') + .and('have.class', 'bg-jade-500') + .invoke('text') + .should('eq', '') + + // go to the Spec Runner route by clicking on a test + cy.contains('a', 'flower.png').click() + + cy.findByTestId('debug-badge-dot').should('have.class', 'bg-gray-800') + }) + it('Specs sidebar nav link is not active when a test is running', () => { cy.location('hash').should('equal', '#/specs') cy.contains('.router-link-exact-active', 'Specs') diff --git a/packages/app/src/navigation/SidebarNavigation.cy.tsx b/packages/app/src/navigation/SidebarNavigation.cy.tsx index 10aeb2997698..c49517dc84b5 100644 --- a/packages/app/src/navigation/SidebarNavigation.cy.tsx +++ b/packages/app/src/navigation/SidebarNavigation.cy.tsx @@ -133,13 +133,18 @@ describe('SidebarNavigation', () => { mountComponent() cy.tick(1000) //wait for debounce - cy.findByLabelText('New Debug feature').should('be.visible').contains('New') + cy.findByLabelText('New Debug feature', { + selector: '[data-cy=debug-badge-dot]', + }).should('be.visible') + cy.percySnapshot('Debug Badge:collapsed') cy.findByLabelText(defaultMessages.sidebar.toggleLabel.collapsed, { selector: 'button', }).click() + cy.tick(1000) //wait for transition + cy.findByLabelText('New Debug feature').should('be.visible').contains('New') cy.percySnapshot('Debug Badge:expanded badge') }) @@ -149,7 +154,9 @@ describe('SidebarNavigation', () => { for (const status of ['NOTESTS', 'RUNNING'] as CloudRunStatus[]) { mountComponent({ cloudProject: { status, numFailedTests: 0 } }) cy.tick(1000) //wait for debounce - cy.findByLabelText('New Debug feature').should('be.visible').contains('New') + cy.findByLabelText('New Debug feature', { + selector: '[data-cy=debug-badge-dot]', + }).should('be.visible') } }) @@ -218,8 +225,9 @@ describe('SidebarNavigation', () => { mountComponent({ online: false }) cy.tick(1000) //wait for debounce - - cy.findByLabelText('New Debug feature').should('be.visible').contains('New') + cy.findByLabelText('New Debug feature', { + selector: '[data-cy=debug-badge-dot]', + }).should('be.visible') }) }) }) diff --git a/packages/app/src/navigation/SidebarNavigationRow.vue b/packages/app/src/navigation/SidebarNavigationRow.vue index c9624ce3e325..dbbe9e8aa150 100644 --- a/packages/app/src/navigation/SidebarNavigationRow.vue +++ b/packages/app/src/navigation/SidebarNavigationRow.vue @@ -48,13 +48,19 @@ {{ name }} {{ badge.value }} +