From 9e2bf5b484bf0564283f91a4dc6e09c7960683c7 Mon Sep 17 00:00:00 2001 From: Zachary Williams Date: Fri, 6 Jan 2023 10:16:47 -0600 Subject: [PATCH] fix: only render debug artifacts when info is available (#25362) Co-authored-by: Stokes Player --- .../app/src/debug/DebugArtifactLink.cy.tsx | 3 +- packages/app/src/debug/DebugArtifactLink.vue | 7 +- packages/app/src/debug/DebugContainer.vue | 2 +- packages/app/src/debug/DebugFailedTest.cy.tsx | 100 +++++++++++------- packages/app/src/debug/DebugFailedTest.vue | 14 +-- packages/app/src/debug/DebugOverLimit.vue | 2 +- packages/app/src/debug/DebugPageDetails.vue | 2 +- .../app/src/debug/DebugPendingRunCounts.vue | 2 +- packages/app/src/debug/DebugRunNumber.vue | 2 +- packages/app/src/debug/DebugSpec.cy.tsx | 3 +- packages/app/src/debug/DebugSpec.vue | 30 +++--- packages/app/src/debug/DebugSpecList.vue | 2 +- .../src/debug/GroupedDebugFailedTest.cy.tsx | 31 +++--- .../app/src/debug/GroupedDebugFailedTest.vue | 15 ++- .../app/src/debug/utils/debugArtifacts.ts | 24 +++++ .../frontend-shared/src/locales/en-US.json | 5 + 16 files changed, 144 insertions(+), 100 deletions(-) create mode 100644 packages/app/src/debug/utils/debugArtifacts.ts diff --git a/packages/app/src/debug/DebugArtifactLink.cy.tsx b/packages/app/src/debug/DebugArtifactLink.cy.tsx index 574b5a3ef664..919abc703d88 100644 --- a/packages/app/src/debug/DebugArtifactLink.cy.tsx +++ b/packages/app/src/debug/DebugArtifactLink.cy.tsx @@ -1,7 +1,8 @@ import DebugArtifactLink from './DebugArtifactLink.vue' +import type { ArtifactType } from './utils/debugArtifacts' describe('', () => { - const artifactMapping: {icon: string, text: string, url: string}[] = [ + const artifactMapping: {icon: ArtifactType, text: string, url: string}[] = [ { icon: 'TERMINAL_LOG', text: 'View Log', url: 'www.cypress.io' }, { icon: 'IMAGE_SCREENSHOT', text: 'View Screenshot', url: 'cloud.cypress.io' }, { icon: 'PLAY', text: 'View Video', url: 'www.cypress.io' }, diff --git a/packages/app/src/debug/DebugArtifactLink.vue b/packages/app/src/debug/DebugArtifactLink.vue index 3f385dc5fbbe..635705840128 100644 --- a/packages/app/src/debug/DebugArtifactLink.vue +++ b/packages/app/src/debug/DebugArtifactLink.vue @@ -32,15 +32,14 @@ import { IconTechnologyTerminalLog, IconTechnologyImageScreenshot, IconActionPlaySmall } from '@cypress-design/vue-icon' import Tooltip from '@packages/frontend-shared/src/components/Tooltip.vue' import ExternalLink from '@cy/gql-components/ExternalLink.vue' +import type { ArtifactType } from './utils/debugArtifacts' const props = defineProps<{ - icon: string + icon: ArtifactType popperText: string - url: string | null | undefined + url: string }>() -type ArtifactType = 'TERMINAL_LOG' | 'IMAGE_SCREENSHOT' | 'PLAY' - const ICON_MAP: Record = { 'TERMINAL_LOG': IconTechnologyTerminalLog, 'IMAGE_SCREENSHOT': IconTechnologyImageScreenshot, diff --git a/packages/app/src/debug/DebugContainer.vue b/packages/app/src/debug/DebugContainer.vue index ab2b6e3336fc..50ca01cd1c3d 100644 --- a/packages/app/src/debug/DebugContainer.vue +++ b/packages/app/src/debug/DebugContainer.vue @@ -54,7 +54,7 @@