From d353931dd9d03866628c7db7cdbb5ddca25ed03e Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Fri, 4 Sep 2026 12:43:43 -0500 Subject: [PATCH] test(desktop): assert tooltip labels stay in inline flow, not inline-flex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The preview-row and terminal-rail tests pinned the label's `inline-flex` class — the very shape that broke multi-line tips. Assert the invariant instead: no flex box under the decoration, and the preview row splits its two lines with a hard break. --- .../chat/composer/status-stack/preview-row.test.tsx | 11 +++++++---- .../src/app/right-sidebar/terminal/rail.test.tsx | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/apps/desktop/src/app/chat/composer/status-stack/preview-row.test.tsx b/apps/desktop/src/app/chat/composer/status-stack/preview-row.test.tsx index 0460291188..ed9140bc35 100644 --- a/apps/desktop/src/app/chat/composer/status-stack/preview-row.test.tsx +++ b/apps/desktop/src/app/chat/composer/status-stack/preview-row.test.tsx @@ -19,7 +19,7 @@ describe('PreviewStatusRow', () => { vi.restoreAllMocks() }) - it('keeps the preview tooltip label inline inside the portaled decoration', async () => { + it('keeps the preview tooltip label in inline flow inside the portaled decoration', async () => { const view = render( { await screen.findByRole('tooltip') const content = document.querySelector('[data-slot="tooltip-content"]') - const label = content?.firstElementChild?.firstElementChild + const decoration = content?.firstElementChild expect(content).not.toBeNull() expect(view.container.contains(content)).toBe(false) - expect(label?.classList.contains('inline-flex')).toBe(true) - expect(label?.classList.contains('flex')).toBe(false) + // The decoration's per-line background only wraps inline FLOW. A flex box + // (block or inline-flex) under it lights the first line and leaves the + // rest dark-on-dark, so the two lines must be split by a hard break. + expect(decoration?.querySelector('.flex, .inline-flex')).toBeNull() + expect(decoration?.querySelector('br')).not.toBeNull() }) it('opens remote non-HTML file artifacts in the in-app preview instead of the local browser bridge', async () => { diff --git a/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx b/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx index 8db59ca9fa..aa451f6b7f 100644 --- a/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx +++ b/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx @@ -19,19 +19,21 @@ describe('TerminalRail', () => { $activeTerminalId.set(null) }) - it('keeps a hotkey label inline inside the portaled tooltip decoration', async () => { + it('keeps a hotkey label in inline flow inside the portaled tooltip decoration', async () => { const view = render() fireEvent.pointerMove(screen.getByRole('tab', { name: '1. PowerShell' }), { pointerType: 'mouse' }) await screen.findByRole('tooltip') const content = document.querySelector('[data-slot="tooltip-content"]') - const label = content?.firstElementChild?.firstElementChild + const decoration = content?.firstElementChild expect(content).not.toBeNull() expect(view.container.contains(content)).toBe(false) - expect(label?.classList.contains('inline-flex')).toBe(true) - expect(label?.classList.contains('flex')).toBe(false) + // No flex box under the decoration: its per-line background only wraps + // inline flow, so a flex label would hang its overflow dark-on-dark. + expect(decoration?.querySelector('.flex, .inline-flex')).toBeNull() + expect(decoration?.textContent).toContain('PowerShell') }) it('⌘-click closes the tab; a plain click selects it', () => {