test(desktop): assert tooltip labels stay in inline flow, not inline-flex
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.
This commit is contained in:
committed by
brooklyn!
parent
a22b295dbd
commit
d353931dd9
@@ -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 () => {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user