mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 04:23:15 -05:00
test(ui): compare the composer height with a sub-pixel tolerance
Chromium reported 175.99998 px before focus and 176 px after, so the exact toBe check failed in about half of the runs. Allow half a pixel. Assisted-by: Claude:claude-sonnet-5-5 playwright
This commit is contained in:
1 file changed
+2
-1
@@ -69,7 +69,8 @@ test.describe('Home composer', () => {
|
||||
await expect(card).toHaveCSS('box-shadow', /inset/)
|
||||
await expect(box).toHaveCSS('outline-style', 'none')
|
||||
await expect(box).toHaveCSS('box-shadow', 'none')
|
||||
expect((await card.boundingBox()).height).toBe(before)
|
||||
// Layout rounds to 1/64 px, so compare with a sub-pixel tolerance.
|
||||
expect(Math.abs((await card.boundingBox()).height - before)).toBeLessThan(0.5)
|
||||
// the control that takes keyboard focus next keeps its own ring
|
||||
await page.keyboard.press('Shift+Tab')
|
||||
await expect(card.locator(':focus-visible')).toHaveCSS('outline-style', 'solid')
|
||||
|
||||
Reference in new issue
Block a user