(textNode, pathNode, errorMargin=0)
| 592 | } |
| 593 | |
| 594 | function assertTextIsInsidePath(textNode, pathNode, errorMargin=0) { |
| 595 | var textBB = textNode.getBoundingClientRect(); |
| 596 | var pathBB = pathNode.getBoundingClientRect(); |
| 597 | |
| 598 | expect(pathBB.left - errorMargin).not.toBeGreaterThan(textBB.left); |
| 599 | expect(textBB.right - errorMargin).not.toBeGreaterThan(pathBB.right); |
| 600 | expect(pathBB.top - errorMargin).not.toBeGreaterThan(textBB.top); |
| 601 | expect(textBB.bottom - errorMargin).not.toBeGreaterThan(pathBB.bottom); |
| 602 | } |
| 603 | |
| 604 | function assertTextIsAbovePath(textNode, pathNode) { |
| 605 | var textBB = textNode.getBoundingClientRect(); |
no outgoing calls
no test coverage detected
searching dependent graphs…