fix: read handle inline style for left% assertion

This commit is contained in:
Terry Jia
2026-03-26 22:46:29 -04:00
parent d1f9c44ced
commit d4ea89ac31

View File

@@ -69,7 +69,10 @@ test.describe('Image Compare', () => {
const handle = node.locator('[role="presentation"]')
await expect(handle).toBeVisible()
await expect(handle).toHaveCSS('left', /50%/)
expect(
await handle.evaluate((el) => (el as HTMLElement).style.left)
).toBe('50%')
await expect(beforeImg).toHaveCSS('clip-path', /50%/)
await expect(node).toHaveScreenshot('image-compare-default-50.png')