(g, content, style)
| 1536 | } |
| 1537 | |
| 1538 | function _assertLabelGroup(g, content, style) { |
| 1539 | var lines = g.selectAll('.nums .line'); |
| 1540 | var name = g.selectAll('.name'); |
| 1541 | var tooltipBoundingBox = g.node().getBoundingClientRect(); |
| 1542 | var nameBoundingBox = name.node().getBoundingClientRect(); |
| 1543 | |
| 1544 | expect(tooltipBoundingBox.top <= nameBoundingBox.top); |
| 1545 | expect(tooltipBoundingBox.bottom >= nameBoundingBox.bottom); |
| 1546 | |
| 1547 | expect(lines.size()).toBe(content.length - 1); |
| 1548 | |
| 1549 | lines.each(function(_, i) { |
| 1550 | expect(d3Select(this).text()).toBe(content[i]); |
| 1551 | }); |
| 1552 | |
| 1553 | expect(name.text()).toBe(content[content.length - 1]); |
| 1554 | |
| 1555 | assertHoverLabelStyle(g, { |
| 1556 | bgcolor: style[0], |
| 1557 | bordercolor: style[1], |
| 1558 | fontSize: style[2], |
| 1559 | fontFamily: style[3], |
| 1560 | fontColor: style[4] |
| 1561 | }); |
| 1562 | } |
| 1563 | |
| 1564 | function assertNoLabel() { |
| 1565 | var g = d3SelectAll('.hovertext'); |
no outgoing calls
no test coverage detected
searching dependent graphs…