(checkLeft, checkRight, checkTop, checkBottom, checkMiddleX)
| 281 | }); |
| 282 | |
| 283 | function _verifyTitle(checkLeft, checkRight, checkTop, checkBottom, checkMiddleX) { |
| 284 | return function() { |
| 285 | var title = d3SelectAll('.titletext text'); |
| 286 | expect(title.size()).toBe(1); |
| 287 | var titleBox = d3Select('g.titletext').node().getBoundingClientRect(); |
| 288 | var funnelareaBox = d3Select('g.trace').node().getBoundingClientRect(); |
| 289 | // check that margins agree. we leave an error margin of 2. |
| 290 | if(checkLeft) expect(Math.abs(titleBox.left - funnelareaBox.left)).toBeLessThan(2); |
| 291 | if(checkRight) expect(Math.abs(titleBox.right - funnelareaBox.right)).toBeLessThan(2); |
| 292 | if(checkTop) expect(Math.abs(titleBox.top - funnelareaBox.top)).toBeLessThan(2); |
| 293 | if(checkBottom) expect(Math.abs(titleBox.bottom - funnelareaBox.bottom)).toBeLessThan(2); |
| 294 | if(checkMiddleX) { |
| 295 | expect(Math.abs(titleBox.left + titleBox.right - funnelareaBox.left - funnelareaBox.right)) |
| 296 | .toBeLessThan(2); |
| 297 | } |
| 298 | }; |
| 299 | } |
| 300 | |
| 301 | it('shows title top center if title.position is undefined', function(done) { |
| 302 | Plotly.newPlot(gd, [{ |
no outgoing calls
no test coverage detected
searching dependent graphs…