* feat(ui-user-questions): show answered batches as shared message bubbles
* refactor(ui-primitives): share clipboard confirmation lifecycle
* test(web): include answered question bubbles in steering goldens
* fix(ui-user-questions): keep answered turns collapsible
* test(ui-user-questions): drop the removed compactAnswer expectation
master removed ChatTurnProcessPresentation.compactAnswer in aaeb344
("fix(chat): keep the reply gap on a folded final answer"); reply spacing
now comes from the adjacent-row rules. The rebase left this assertion
behind, so the parametrized replay/live/prepend cases failed on every CI
coverage lane even though typecheck stayed green: toMatchObject accepts
the stale property.
* fix(ui-user-questions): address answer bubble review feedback
* test(web): observe file card styles after both cards mount
---------
Co-authored-by: imccyu <[email protected]>
25 lines
1.0 KiB
TypeScript
25 lines
1.0 KiB
TypeScript
// @vitest-environment jsdom
|
|
import { cleanup, render, screen } from '@testing-library/react'
|
|
import { afterEach, describe, expect, it } from 'vitest'
|
|
import { UserMessageBubble } from '../src/UserMessageBubble.tsx'
|
|
|
|
afterEach(cleanup)
|
|
|
|
describe('UserMessageBubble', () => {
|
|
it('preserves caller content, attributes, and layout class', () => {
|
|
render(<UserMessageBubble className="owner-layout" role="group" aria-label="answer">
|
|
<dl><dt>Which color?</dt><dd>Blue</dd></dl>
|
|
</UserMessageBubble>)
|
|
const surface = screen.getByRole('group', { name: 'answer' })
|
|
expect(surface.classList.contains('owner-layout')).toBe(true)
|
|
expect(screen.getByText('Which color?').tagName).toBe('DT')
|
|
expect(screen.getByText('Blue').tagName).toBe('DD')
|
|
})
|
|
|
|
it('renders a plain surface without additional interaction', () => {
|
|
render(<UserMessageBubble>Plain user text</UserMessageBubble>)
|
|
expect(screen.getByText('Plain user text').tagName).toBe('DIV')
|
|
expect(screen.queryByRole('button')).toBeNull()
|
|
})
|
|
})
|