MCPcopy
hub / github.com/vuejs/core / assertPolygon

Function assertPolygon

packages/vue/__tests__/e2e/svg.spec.ts:22–39  ·  view source on GitHub ↗
(total: number)

Source from the content-addressed store, hash-verified

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) {

Callers 1

testSvgFunction · 0.85

Calls 3

mapMethod · 0.80
querySelectorMethod · 0.80
evaluateMethod · 0.65

Tested by

no test coverage detected