(hitbox, symbol, text)
| 980 | |
| 981 | // The hit box runs from the leftmost to the rightmost edge of what is drawn. |
| 982 | function expectHitBoxToCover(hitbox, symbol, text) { |
| 983 | expect(hitbox.left).toBeCloseTo(Math.min(symbol.left, text.left), 0); |
| 984 | expect(hitbox.left + hitbox.width).toBeCloseTo(Math.max(symbol.right, text.right), 0); |
| 985 | } |
| 986 | |
| 987 | for (const position of ['left', 'right', 'top', 'bottom']) { |
| 988 | for (const textAlign of ['left', 'center', 'right']) { |