Skip to content

The agent that grows with you

test(desktop): assert tooltip labels stay in inline flow, not inline-flex

Brooklyn Nicholsond353931dd9d0
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 0460291188e..ed9140bc35e 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(
<PreviewStatusRow
item={{ cwd: 'C:\\repo', id: 'preview.html', label: 'preview.html', target: 'preview.html' }}
@@ -31,12 +31,15 @@ describe('PreviewStatusRow', () => {
await screen.findByRole('tooltip')
const content = document.querySelector<HTMLElement>('[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 8db59ca9fa1..aa451f6b7fa 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(<TerminalRail />)
fireEvent.pointerMove(screen.getByRole('tab', { name: '1. PowerShell' }), { pointerType: 'mouse' })
await screen.findByRole('tooltip')
const content = document.querySelector<HTMLElement>('[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', () => {