fix(unify): Cypress version link should point to Cypress doc's changelog (#20869)

This commit is contained in:
David Munechika
2022-04-04 17:15:22 -04:00
committed by GitHub
parent e6cbc5ae1e
commit 3f32ffd747
3 changed files with 13 additions and 11 deletions
+4 -4
View File
@@ -139,7 +139,7 @@ describe('App Top Nav Workflows', () => {
cy.findByTestId('app-header-bar').validateExternalLink({
name: 'v10.0.0',
href: 'https://github.com/cypress-io/cypress/releases/tag/v10.0.0',
href: 'https://on.cypress.io/changelog#10-0-0',
})
})
})
@@ -174,14 +174,14 @@ describe('App Top Nav Workflows', () => {
cy.findByTestId('top-nav-version-list').contains('v10.0.0 • Upgrade').click()
cy.findByTestId('update-hint').within(() => {
cy.validateExternalLink({ name: '10.1.0', href: 'https://github.com/cypress-io/cypress/releases/tag/v10.1.0' })
cy.validateExternalLink({ name: '10.1.0', href: 'https://on.cypress.io/changelog#10-1-0' })
cy.findByText('Latest').should('be.visible')
})
cy.findByTestId('cypress-update-popover').findByRole('button', { name: 'Update to 10.1.0' })
cy.findByTestId('current-hint').within(() => {
cy.validateExternalLink({ name: '10.0.0', href: 'https://github.com/cypress-io/cypress/releases/tag/v10.0.0' })
cy.validateExternalLink({ name: '10.0.0', href: 'https://on.cypress.io/changelog#10-0-0' })
cy.findByText('Installed').should('be.visible')
})
@@ -239,7 +239,7 @@ describe('App Top Nav Workflows', () => {
cy.findByTestId('app-header-bar').validateExternalLink({
name: `v${pkg.version}`,
href: `https://github.com/cypress-io/cypress/releases/tag/v${pkg.version}`,
href: `https://on.cypress.io/changelog#${pkg.version.replaceAll('.', '-')}`,
})
})
})
@@ -120,7 +120,7 @@ describe('<HeaderBarContent />', { viewportWidth: 1000, viewportHeight: 750 }, (
),
})
cy.contains('a', '8.7.0').should('be.visible').and('have.attr', 'href', 'https://github.com/cypress-io/cypress/releases/tag/v8.7.0')
cy.contains('a', '8.7.0').should('be.visible').and('have.attr', 'href', 'https://on.cypress.io/changelog#8-7-0')
cy.percySnapshot()
})
@@ -22,7 +22,7 @@
>
<div class="font-medium">
<ExternalLink
:href="`${releasesUrl}/tag/v${versions.latest.version}`"
:href="changelogLink(versions.latest.version)"
class="text-indigo-500"
data-cy="latest-version"
>
@@ -58,7 +58,7 @@
>
<div class="whitespace-nowrap">
<ExternalLink
:href="`${releasesUrl}/tag/v${versions.current.version}`"
:href="changelogLink(versions.current.version)"
class="font-medium text-amber-800"
data-cy="current-version"
>
@@ -88,7 +88,7 @@
<ExternalLink
v-else-if="versions"
:href="`${releasesUrl}/tag/v${versions.latest.version}`"
:href="changelogLink(versions.current.version)"
class="flex font-medium outline-transparent text-gray-600 gap-8px items-center group hocus:text-indigo-500 hocus:outline-0"
:use-default-hocus="false"
data-cy="top-nav-cypress-version-current-link"
@@ -97,7 +97,7 @@
class="h-16px w-16px group-hocus:icon-dark-indigo-500 group-hocus:icon-light-indigo-50 icon-dark-gray-500 icon-light-gray-100"
/>
<span>
v{{ versions.latest.version }}
v{{ versions.current.version }}
</span>
</ExternalLink>
@@ -211,8 +211,6 @@ import VerticalBrowserListItems from './VerticalBrowserListItems.vue'
const { t } = useI18n()
const releasesUrl = 'https://github.com/cypress-io/cypress/releases'
gql`
fragment TopNav on Query {
versions {
@@ -352,4 +350,8 @@ onKeyStroke(['Enter', ' ', 'Escape'], (event) => {
resetPrompt(event)
})
const changelogLink = (version) => {
return `https://on.cypress.io/changelog#${version.replaceAll('.', '-')}`
}
</script>