fix(editor): sub-pixel tolerance on the 375 px sheet width check
This commit is contained in:
1 parent
96e301ab69
commit
50256b19f1
1 file changed
+2
-1
@@ -576,7 +576,8 @@ test.describe('citations sheet, read-only at 375 px', () => {
|
|||||||
// Full width: the sheet is min(34 rem, 100 vw), so the whole phone screen.
|
// Full width: the sheet is min(34 rem, 100 vw), so the whole phone screen.
|
||||||
const layer = page.locator('[data-place="citations"]')
|
const layer = page.locator('[data-place="citations"]')
|
||||||
const box = await layer.boundingBox()
|
const box = await layer.boundingBox()
|
||||||
expect(box?.width ?? 0).toBeLessThanOrEqual(375)
|
// Sub-pixel layout rounding (375.00001…): the tolerance of editor-shell-layout (3a7ffa2).
|
||||||
|
expect(box?.width ?? 0).toBeLessThanOrEqual(375 + 0.5)
|
||||||
expect(Math.abs((box?.width ?? 0) - 375)).toBeLessThan(1)
|
expect(Math.abs((box?.width ?? 0) - 375)).toBeLessThan(1)
|
||||||
await expect(heads(page)).toHaveCount(3)
|
await expect(heads(page)).toHaveCount(3)
|
||||||
await expectNoHorizontalOverflow(page, 'the sheet at 375 px')
|
await expectNoHorizontalOverflow(page, 'the sheet at 375 px')
|
||||||
|
|||||||
Reference in new issue
Block a user