mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 09:27:29 +00:00
test: align floating tab width coverage with 300px cap (#37579)
This commit is contained in:
@@ -186,12 +186,12 @@ test('floating tabs keep their preferred width and share constrained space befor
|
||||
await openFloatingPanel(orcaPage)
|
||||
const panel = orcaPage.locator(OPEN_PANEL_SELECTOR).first()
|
||||
await panel.evaluate((element) => {
|
||||
element.style.maxWidth = '720px'
|
||||
element.style.maxWidth = '660px'
|
||||
})
|
||||
const firstSlot = panel.locator(`[data-tab-strip-slot="${first}"]`)
|
||||
const width = (): Promise<number> =>
|
||||
firstSlot.evaluate((element) => element.getBoundingClientRect().width)
|
||||
await expect.poll(width).toBeCloseTo(330, 0)
|
||||
await expect.poll(width).toBeCloseTo(300, 0)
|
||||
const singleWidth = await width()
|
||||
const strip = panel.locator('.terminal-tab-strip').first()
|
||||
|
||||
@@ -201,12 +201,12 @@ test('floating tabs keep their preferred width and share constrained space befor
|
||||
expect(await width()).toBeLessThan(singleWidth)
|
||||
const twoTabWidth = await width()
|
||||
await panel.evaluate((element) => {
|
||||
element.style.maxWidth = '600px'
|
||||
element.style.maxWidth = '540px'
|
||||
})
|
||||
await expect.poll(width).toBeLessThan(twoTabWidth)
|
||||
expect(await width()).toBeCloseTo((await strip.evaluate((el) => el.clientWidth)) / 2, 0)
|
||||
await panel.evaluate((element) => {
|
||||
element.style.maxWidth = '720px'
|
||||
element.style.maxWidth = '660px'
|
||||
})
|
||||
await expect.poll(width).toBeCloseTo(twoTabWidth, 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user