-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Closes #25418
- Loading branch information
1 parent
9e2bf5b
commit 36a6eea
Showing
8 changed files
with
116 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import DebugSpecLimitBanner from './DebugSpecLimitBanner.vue' | ||
import { defaultMessages } from '@cy/i18n' | ||
|
||
describe('<DebugSpecLimitBanner />', () => { | ||
it('renders expected copy and link', () => { | ||
cy.mount(() => ( | ||
<DebugSpecLimitBanner | ||
failedTestCount={120} | ||
cloudRunUrl="#" | ||
/> | ||
)) | ||
|
||
cy.contains(defaultMessages.debugPage.limit.title) | ||
cy.contains(defaultMessages.debugPage.limit.message.split('|')[0].trim().replace('{n}', '120')) | ||
cy.contains(defaultMessages.debugPage.limit.link) | ||
|
||
cy.viewport(1000, 400) | ||
cy.percySnapshot('large viewport') | ||
|
||
cy.viewport(600, 400) | ||
cy.percySnapshot('small viewport') | ||
}) | ||
|
||
it('does not render link if no url provided', () => { | ||
cy.mount(() => ( | ||
<DebugSpecLimitBanner | ||
failedTestCount={120} | ||
cloudRunUrl={null} | ||
/> | ||
)) | ||
|
||
cy.get('a').should('not.exist') | ||
|
||
cy.percySnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div | ||
id="limit-row" | ||
data-cy="debug-spec-limit" | ||
class="w-full py-16px px-24px gap-y-1" | ||
> | ||
<ul class="rounded flex flex-row flex-wrap bg-indigo-50 border-indigo-100 p-12px p-4 gap-x-2 items-center whitespace-nowrap children:flex children:items-center"> | ||
<li class="font-medium text-sm text-gray-900"> | ||
{{ t('debugPage.limit.title') }} | ||
</li> | ||
<li class="font-normal text-sm text-gray-700"> | ||
{{ t('debugPage.limit.message', { n: failedTestCount }) }} | ||
</li> | ||
<li | ||
v-if="cloudRunUrl" | ||
class="text-sm" | ||
> | ||
<ExternalLink :href="cloudRunUrl"> | ||
{{ t('debugPage.limit.link') }} | ||
</ExternalLink> | ||
</li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import ExternalLink from '@cy/gql-components/ExternalLink.vue' | ||
import { useI18n } from '@cy/i18n' | ||
const { t } = useI18n() | ||
defineProps<{ | ||
failedTestCount: number | ||
cloudRunUrl: string | null | ||
}>() | ||
</script> | ||
|
||
<style scoped> | ||
#limit-row li:not(:first-child)::before { | ||
content: '•'; | ||
@apply text-lg text-gray-500 pr-8px | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters