From 1bf27f0dde6b8ea867d3343338f38b0e0a7c4ebb Mon Sep 17 00:00:00 2001 From: Jacob Erdman <56931564+jacoberdman2147@users.noreply.github.com> Date: Mon, 9 Dec 2024 02:28:04 -0800 Subject: [PATCH] feat(ui): Make clicking on a test in the UI open the report section and scroll to the test failure if applicable (#6900) --- packages/ui/client/auto-imports.d.ts | 2 ++ packages/ui/client/components/Navigation.vue | 4 +-- .../components/explorer/ExplorerItem.vue | 1 + .../ui/client/components/views/ViewReport.vue | 15 +++++++++- packages/ui/client/composables/codemirror.ts | 7 ++++- packages/ui/client/composables/navigation.ts | 29 +++++++++++-------- packages/ui/client/composables/params.ts | 3 ++ 7 files changed, 45 insertions(+), 16 deletions(-) diff --git a/packages/ui/client/auto-imports.d.ts b/packages/ui/client/auto-imports.d.ts index 620c0ef2bd39..e5a11a01d5a7 100644 --- a/packages/ui/client/auto-imports.d.ts +++ b/packages/ui/client/auto-imports.d.ts @@ -118,6 +118,7 @@ declare global { const resolveComponent: typeof import('vue')['resolveComponent'] const resolveRef: typeof import('@vueuse/core')['resolveRef'] const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] + const selectedTest: typeof import('./composables/params')['selectedTest'] const setIframeViewport: typeof import('./composables/api')['setIframeViewport'] const shallowReactive: typeof import('vue')['shallowReactive'] const shallowReadonly: typeof import('vue')['shallowReadonly'] @@ -127,6 +128,7 @@ declare global { const showDashboard: typeof import('./composables/navigation')['showDashboard'] const showLine: typeof import('./composables/codemirror')['showLine'] const showNavigationPanel: typeof import('./composables/navigation')['showNavigationPanel'] + const showReport: typeof import('./composables/navigation')['showReport'] const showRightPanel: typeof import('./composables/navigation')['showRightPanel'] const showSource: typeof import('./composables/codemirror')['showSource'] const syncRef: typeof import('@vueuse/core')['syncRef'] diff --git a/packages/ui/client/components/Navigation.vue b/packages/ui/client/components/Navigation.vue index 8bb8af54fd96..1c4abd735ba7 100644 --- a/packages/ui/client/components/Navigation.vue +++ b/packages/ui/client/components/Navigation.vue @@ -11,9 +11,9 @@ import { coverageVisible, dashboardVisible, disableCoverage, - navigateTo, showCoverage, showDashboard, + showReport, } from '~/composables/navigation' function updateSnapshot() { @@ -50,7 +50,7 @@ function expandTests() {