反应测试库未通过无关测试

时间:2019-03-27 21:36:42

标签: reactjs react-testing-library

我正在尝试测试组件,但发现该测试失败,并且无法真正弄清楚为什么在完全不相关的组件上测试会失败。

      at Object.<anonymous> (src/screens/cook/restaurant/create/submit-button/submit-button.tsx:70:23)
      at Object.<anonymous> (src/screens/cook/restaurant/create/submit-button/index.ts:1:1)
      at Object.<anonymous> (src/screens/cook/restaurant/create/form.tsx:9:1)
      at Object.<anonymous> (src/screens/cook/restaurant/create/layout.tsx:4:1)
      at Object.<anonymous> (src/screens/cook/restaurant/create/container.tsx:7:1)
      at Object.<anonymous> (src/screens/cook/restaurant/api/index.ts:14:1)
      at Object.<anonymous> (src/screens/home/sections/subscribe.tsx:13:1)
      at Object.<anonymous> (src/screens/home/sections/index.ts:3:1)
      at Object.<anonymous> (src/screens/home/layout.tsx:4:1)
      at Object.<anonymous> (src/screens/home/container.tsx:2:1)
      at Object.<anonymous> (src/screens/routes.tsx:13:1)
      at Object.<anonymous> (src/App.tsx:9:1)
      at Object.<anonymous> (src/components/reserved-events-card/card-body.tsx:11:1)
      at Object.<anonymous> (src/components/reserved-events-card/card-content.tsx:3:1)
      at Object.<anonymous> (src/components/reserved-events-card/layout.tsx:6:1)
      at Object.<anonymous> (src/components/reserved-events-card/container.tsx:4:1)
      at Object.<anonymous> (src/components/reserved-events-card/index.ts:1:1)
      at Object.<anonymous> (src/components/index.ts:12:1)
      at Object.<anonymous> (src/screens/cook/summary/incomplete-events/incomplete-table.tsx:6:1)
      at Object.<anonymous> (src/screens/cook/summary/incomplete-events/index.ts:7:1)
      at Object.<anonymous> (src/screens/cook/summary/layout.tsx:6:1)
      at Object.<anonymous> (src/screens/cook/summary/container.tsx:4:1)
      at Object.<anonymous> (src/screens/cook/summary/__tests__/summary.container.test.tsx:8:1)

如您所见,追溯一直追溯到我的条目文件,然后一直追溯到产生错误的地方。

submit-button组件未在summary.container.

中的任何位置使用

0 个答案:

没有答案