无法使用反应测试库测试包含 SVG 的组件

时间:2021-04-24 11:38:00

标签: javascript reactjs unit-testing svg jestjs

这是我在尝试测试包含 SVG 内置函数之一的组件时遇到的错误

<块引用>

TypeError: circle.getPointAtLength 不是函数


      49 |         let sdo = circle.getAttribute("stroke-dashoffset")
      50 |         let arcpos = sda - sdo
    > 51 |         let points = circle.getPointAtLength(arcpos)
         |                             ^
      52 |         let thumb = document.getElementById("thumb" + key)
      53 |         thumb.setAttribute("cx", points.x)
      54 |         thumb.setAttribute("cy", points.y)

0 个答案:

没有答案