test(web): cover optimized streaming paths
This commit is contained in:
parent
2ab37e9558
commit
6401a64e20
2 changed files with 13 additions and 4 deletions
|
|
@ -188,10 +188,16 @@ describe('web e2e: lifecycle & chrome (workspace flow / reload / dark mode)', ()
|
|||
await input.press('Enter')
|
||||
if (MODE !== 'record') {
|
||||
const liveTail = page.locator('[data-variant="think"][data-state="running"] [data-follow-end]')
|
||||
await expect.poll(async () => await liveTail.evaluate(element => (
|
||||
element.scrollWidth > element.clientWidth
|
||||
&& element.scrollLeft >= element.scrollWidth - element.clientWidth - 1
|
||||
)), { timeout: 10_000, interval: 10 }).toBe(true)
|
||||
await expect.poll(async () => {
|
||||
if (await liveTail.count() !== 1) return false
|
||||
return await liveTail.evaluate((element) => {
|
||||
const text = element.firstElementChild
|
||||
if (!(text instanceof HTMLElement)) return false
|
||||
const viewport = element.getBoundingClientRect()
|
||||
const content = text.getBoundingClientRect()
|
||||
return content.width > viewport.width && Math.abs(content.right - viewport.right) <= 1
|
||||
})
|
||||
}, { timeout: 10_000, interval: 10 }).toBe(true)
|
||||
}
|
||||
return await settled
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -382,6 +382,9 @@ describe('produced-file Turn data', () => {
|
|||
value.append(call(4, 'second', 'edit', {
|
||||
file_path: 'second.txt', old_string: 'before', new_string: 'after',
|
||||
}))
|
||||
value.flush()
|
||||
expect(deliverablesOf(value)).toBe(first)
|
||||
|
||||
value.append(result(5, 'second'))
|
||||
value.flush()
|
||||
expect(producedForClosing(deliverablesOf(value))).toEqual(['first.txt', 'second.txt'])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue