From 9060a88ddebd0ef455334b71a45ef6502d7c14e7 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 10 Aug 2026 01:24:54 -0700 Subject: [PATCH] fix: contain unbroken dialog failure output (#13531) --- ...CrashReportDialogSurface.overflow.test.tsx | 84 +++++++++++++++++++ .../crash-report/CrashReportDialogSurface.tsx | 6 +- .../SkillFreshnessUpdateDialog.test.tsx | 49 ++++++++++- .../skills/SkillFreshnessUpdateDialog.tsx | 12 +-- 4 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 src/renderer/src/components/crash-report/CrashReportDialogSurface.overflow.test.tsx diff --git a/src/renderer/src/components/crash-report/CrashReportDialogSurface.overflow.test.tsx b/src/renderer/src/components/crash-report/CrashReportDialogSurface.overflow.test.tsx new file mode 100644 index 00000000000..a26ff7b8942 --- /dev/null +++ b/src/renderer/src/components/crash-report/CrashReportDialogSurface.overflow.test.tsx @@ -0,0 +1,84 @@ +// @vitest-environment happy-dom + +import type { ReactNode } from 'react' +import { cleanup, render, waitFor } from '@testing-library/react' +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' +import type { CrashReportRecord } from '../../../../shared/crash-reporting' +import { CrashReportDialogSurface } from './CrashReportDialogSurface' + +const viewer = vi.fn(async () => null) + +vi.mock('./use-crash-report-copy', () => ({ + useCrashReportCopy: () => vi.fn(async () => {}) +})) + +vi.mock('@/components/ui/dialog', () => ({ + Dialog: ({ open, children }: { open: boolean; children?: ReactNode }) => + open ?
{children}
, + DialogFooter: ({ children }: { children?: ReactNode }) =>
+
{diagnosticText}
+
{output.trim()}
{state.error}
+{state.error}
) : ( headline )} @@ -323,14 +323,14 @@ export function SkillFreshnessUpdateDialog(): React.JSX.Element { ) : null} {run.state === 'error' ? ( -{translate( 'auto.components.skills.SkillFreshnessUpdateDialog.errorTitle', "The update didn't finish" )}
-+
{run.message}