Skip to content

Commit

Permalink
misc: Increase max failures in IATR badge to 99 (#25737)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-plummer authored Feb 9, 2023
1 parent 9aad2aa commit 199c4e6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _Released 02/14/2023 (PENDING)_
- Improved the layout of the Debug Page on smaller viewports when there is a pending run. Addresses [#25664](https://github.com/cypress-io/cypress/issues/25664).
- Improved the layout of the Debug Page when displaying informational messages. Addresses [#25669](https://github.com/cypress-io/cypress/issues/25669).
- Icons in Debug page will no longer shrink at small viewports. Addresses [#25665](https://github.com/cypress-io/cypress/issues/25665).
- Increased maximum number of failing tests to reflect in sidebar badge to 99. Addresses [#25662](https://github.com/cypress-io/cypress/issues/25662).
- Improved the layout of the Debug Page empty states on smaller viewports. Addressed in [#25703](https://github.com/cypress-io/cypress/pull/25703).
- Increased the spacing between elements and their associated tooltip and added borders around artifact links on the Debug Page. Addresses [#25666](https://github.com/cypress-io/cypress/issues/25666).

Expand Down
8 changes: 6 additions & 2 deletions packages/app/src/navigation/SidebarNavigation.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,14 @@ describe('SidebarNavigation', () => {
it('renders failure badge', () => {
mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 1 } })
cy.findByLabelText('Relevant run had 1 test failure').should('be.visible').contains('1')
cy.percySnapshot('Debug Badge:failed')
cy.percySnapshot('Debug Badge:failed:single-digit')

mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 10 } })
cy.findByLabelText('Relevant run had 10 test failures').should('be.visible').contains('9+')
cy.findByLabelText('Relevant run had 10 test failures').should('be.visible').contains('10')
cy.percySnapshot('Debug Badge:failed:double-digit')

mountComponent({ cloudProject: { status: 'FAILED', numFailedTests: 100 } })
cy.findByLabelText('Relevant run had 100 test failures').should('be.visible').contains('99+')
cy.percySnapshot('Debug Badge:failed:truncated')
})

Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/navigation/SidebarNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ watchEffect(() => {
let countToDisplay = '0'
if (totalFailed) {
countToDisplay = totalFailed < 9
countToDisplay = totalFailed < 99
? String(totalFailed)
: '9+'
: '99+'
}
if (status === 'FAILED') {
Expand Down
18 changes: 17 additions & 1 deletion packages/app/src/navigation/SidebarNavigationRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,23 @@ const props = withDefaults(defineProps <{
})
const badgeVariant = computed(() => {
return props.isNavBarExpanded ? 'ml-16px h-20px text-sm leading-3' : 'absolute outline-gray-1000 outline-2px outline bottom-0 left-36px text-xs h-16px leading-2'
const classes: string[] = []
if (props.isNavBarExpanded) {
classes.push('ml-16px', 'h-20px', 'text-sm', 'leading-3')
} else {
classes.push('absolute', 'outline-gray-1000', 'outline-2px', 'outline', 'bottom-0', 'text-xs', 'h-16px', 'leading-2')
// Keep failure count from overflowing sidebar (#25662)
if ((props.badge.status === 'failed' || props.badge.status === 'error') && props.badge.value.length >= 3) {
classes.push('right-4px')
} else {
// Anything else should left-align and overflow sidebar if needed
classes.push('left-36px')
}
}
return classes
})
const badgeColorStyles = {
Expand Down

5 comments on commit 199c4e6

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 199c4e6 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/linux-arm64/develop-199c4e6ba2db98cdf7d92a577c96b4716ecea1e5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 199c4e6 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/linux-x64/develop-199c4e6ba2db98cdf7d92a577c96b4716ecea1e5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 199c4e6 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/darwin-arm64/develop-199c4e6ba2db98cdf7d92a577c96b4716ecea1e5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 199c4e6 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/darwin-x64/develop-199c4e6ba2db98cdf7d92a577c96b4716ecea1e5/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 199c4e6 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.6.0/win32-x64/develop-199c4e6ba2db98cdf7d92a577c96b4716ecea1e5/cypress.tgz

Please sign in to comment.