Skip to content

Commit

Permalink
chore: cleanup PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpowell88 committed May 16, 2023
1 parent 34320d4 commit 28d8f35
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _Released 05/23/2023 (PENDING)_

**Features:**

- Add Git related messages for the Runs and Debug Page when users aren't using Git or their are no recorded runs for the current branch. Fixes [#26680](https://github.com/cypress-io/cypress/issues/26680).
- Add Git-related messages for the [Runs page](https://docs.cypress.io/guides/core-concepts/cypress-app#Runs) and [Debug page](https://docs.cypress.io/guides/cloud/runs#Debug) when users aren't using Git or there are no recorded runs for the current branch. Fixes [#26680](https://github.com/cypress-io/cypress/issues/26680).

**Bugfixes:**

Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/debug/DebugContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ fragment DebugSpecs on Query {
const props = withDefaults(defineProps<{
gql?: DebugSpecsFragment
// This prop is just to stub the error state for now
showError?: boolean
isLoading?: boolean
commitsAhead?: number
online?: boolean
Expand Down
5 changes: 3 additions & 2 deletions packages/app/src/debug/empty/DebugBranchError.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import DebugBranchError from './DebugBranchError.vue'
import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json'

describe('<DebugBranchError />', () => {
it('can mount', () => {
cy.mount(<DebugBranchError />)
cy.contains('No runs found for your branch')
cy.contains('Cypress uses Git to show runs for your branch. Ensure that version control is properly configured and that you are sending Git information to Cypress Cloud.')
cy.contains(defaultMessages.debugPage.emptyStates.noRunsFoundForBranch)
cy.contains(defaultMessages.debugPage.emptyStates.noRunsForBranchMessage)
cy.contains('Learn more').should('have.attr', 'href', 'https://on.cypress.io/git-info?utm_source=Binary%3A+Launchpad&utm_medium=Debug+Tab&utm_campaign=Learn+More')
})
})
2 changes: 1 addition & 1 deletion packages/app/src/debug/empty/DebugEmptyStates.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('Debug page empty states', { defaultCommandTimeout: 250 }, () => {
context('not using git', () => {
it('renders', () => {
mountWithGql(<DebugError />)

cy.findByText('Git repository not detected').should('be.visible')
cy.percySnapshot()
})
})
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/debug/empty/DebugEmptyView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<component
:is="icon"
v-if="icon"
class="icon-dark-gray-500 icon-light-indigo-100"
/>
<div v-else>
<i-cy-box-open_x48 class="icon-dark-gray-500 icon-light-indigo-100" />
Expand Down
12 changes: 12 additions & 0 deletions packages/frontend-shared/src/warning/Warning.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,16 @@ describe('<Warning />', () => {
cy.get(`[aria-label=${defaultMessages.components.alert.dismissAriaLabel}`).first().click()
cy.wrap(onUpdate).should('be.called')
})

it('renders with a Learn more Link', () => {
const link = 'https://on.cypress.io/git-info'

cy.mount(() => (<div class="p-4"><Warning
title={title}
message={message}
helpLinkHref={link}
/></div>))

cy.contains('Learn more').should('have.attr', 'href', link)
})
})
12 changes: 7 additions & 5 deletions packages/frontend-shared/src/warning/Warning.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
class="warning-markdown"
v-html="markdown"
/>
<ExternalLink
v-if="helpLinkHref"
:href="helpLinkHref"
>
{{ t('links.learnMoreButton') }}
</ExternalLink>
<Button
v-if="retryable"
size="md"
Expand All @@ -30,6 +36,7 @@ import ErrorOutlineIcon from '~icons/cy/status-errored-outline_x16.svg'
import { useMarkdown } from '@packages/frontend-shared/src/composables/useMarkdown'
import Alert from '@cy/components/Alert.vue'
import Button from '@cy/components/Button.vue'
import ExternalLink from '../gql-components/ExternalLink.vue'
import RefreshIcon from '~icons/cy/refresh_x16'
import { computed, ref } from 'vue'
import { useVModels } from '@vueuse/core'
Expand Down Expand Up @@ -66,11 +73,6 @@ let message = computed(() => {
return [props.message, ` ${ props.details }`].join('\n\n')
}
if (props.helpLinkHref) {
// eslint-disable-next-line prefer-template
return props.message + ` <span class="ml-[4px]"><a href="${props.helpLinkHref}" class="text-indigo-500 hocus-link-default">${t('links.learnMoreButton')}</a></span>`
}
return props.message
})
Expand Down

0 comments on commit 28d8f35

Please sign in to comment.