(total: number)
| 20 | |
| 21 | // assert the shape of the polygon is correct |
| 22 | async function assertPolygon(total: number) { |
| 23 | expect( |
| 24 | await page().evaluate( |
| 25 | ([total]) => { |
| 26 | const points = globalStats |
| 27 | .map((stat, i) => { |
| 28 | const point = valueToPoint(stat.value, i, total) |
| 29 | return point.x + ',' + point.y |
| 30 | }) |
| 31 | .join(' ') |
| 32 | return ( |
| 33 | document.querySelector('polygon')!.attributes[0].value === points |
| 34 | ) |
| 35 | }, |
| 36 | [total], |
| 37 | ), |
| 38 | ).toBe(true) |
| 39 | } |
| 40 | |
| 41 | // assert the position of each label is correct |
| 42 | async function assertLabels(total: number) { |
no test coverage detected