mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-31 02:13:36 +08:00
Use closeTo in overlay tests
Depending on the platform/monitor/mode the css width/height might be off by 0.5px. Bug: none Change-Id: I2e9038ba22a0dd63cd674bfd68571194e47f1759 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4016406 Reviewed-by: Philip Pfaffe <pfaffe@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
7a4d800cdb
commit
633bba159e
@@ -196,13 +196,13 @@ export function drawGridLineNamesAndAssertLabels(
|
||||
}
|
||||
|
||||
if (expected.type === 'column' && typeof expected.x !== 'undefined') {
|
||||
assert.strictEqual(
|
||||
foundLabel.x, expected.x,
|
||||
assert.closeTo(
|
||||
foundLabel.x, expected.x, 0.5,
|
||||
`Expected column line name label ${expected.textContent} to be positioned at ${expected.x}px`);
|
||||
}
|
||||
if (expected.type === 'row' && typeof expected.y !== 'undefined') {
|
||||
assert.strictEqual(
|
||||
foundLabel.y, expected.y,
|
||||
assert.closeTo(
|
||||
foundLabel.y, expected.y, 0.5,
|
||||
`Expected row line name label ${expected.textContent} to be positioned at ${expected.y}px`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user