test(web): verify reasoning header alignment and sticky container
This commit is contained in:
1 parent
1f87f2561d
commit
42da4c1b58
2 files changed
+8
-5
No files matched your search
@@ -238,6 +238,10 @@ it.skipIf(MODE === 'record')('persists Bing reasoning translation across reopen
|
||||
expect(await typography()).toEqual(translatedTypography)
|
||||
await page.mouse.move(0, 0)
|
||||
const translationAction = reasoning.getByRole('button', { name: '查看译文', exact: true })
|
||||
const titleBox = await reasoning.getByRole('button', { name: '思考', exact: true }).boundingBox()
|
||||
const actionBox = await translationAction.boundingBox()
|
||||
if (titleBox === null || actionBox === null) throw new Error('Reasoning title and translation action must be visible')
|
||||
expect(actionBox.y + actionBox.height / 2).toBeCloseTo(titleBox.y + titleBox.height / 2, 1)
|
||||
expect(await translationAction.evaluate(element => getComputedStyle(element).opacity)).toBe('1')
|
||||
await translationAction.click()
|
||||
await composer.focus()
|
||||
|
||||
@@ -399,14 +399,13 @@ describe('web e2e: lifecycle & chrome (workspace flow / reload / dark mode)', ()
|
||||
const processWasOpen = await process.getAttribute('aria-expanded') === 'true'
|
||||
try {
|
||||
await expandOwningTurnProcess(page, thinkRow)
|
||||
const collapsedHeader = thinkRow.locator('[data-disclosure-row]').first()
|
||||
const collapsedHeader = thinkRow.locator('[data-disclosure-header]').first()
|
||||
await collapsedHeader.waitFor({ timeout: 10_000 })
|
||||
// Collapsed, the rule's `data-open` gate is absent and the header stays in
|
||||
// flow. It is `relative` here — the row is the sweep-glare overlay anchor
|
||||
// — so the assertion is the absence of `sticky`, not a specific value.
|
||||
// flow, so assert the absence of `sticky`, not a specific value.
|
||||
expect(await collapsedHeader.evaluate(element => getComputedStyle(element).position)).not.toBe('sticky')
|
||||
await collapsedHeader.click()
|
||||
const openHeader = page.locator('[data-variant="think"] [data-open] [data-disclosure-row]').first()
|
||||
await collapsedHeader.locator('[data-disclosure-row]').click()
|
||||
const openHeader = page.locator('[data-variant="think"] [data-open] [data-disclosure-header]').first()
|
||||
await openHeader.waitFor({ timeout: 10_000 })
|
||||
const openStyle = await openHeader.evaluate((element) => {
|
||||
const style = getComputedStyle(element)
|
||||
|
||||
Reference in new issue
Block a user