reactjs - 方法“模拟”意味着在 1 个节点上运行。发现 0 相反错误出现在终端上
问题描述
我最近对 POdashboard.js 组件进行了一些更改并运行了测试套件。后来我在终端中的 POdashboard.test.js 上收到以下错误。
PoDashboard 组件 › 应该使用有效的道具呈现 DataTable 组件
方法“模拟”意味着在 1 个节点上运行。找到了 0 个。
expect(poDashboardComponent.find('DataTable').props().onChangeRowsPerPage()).toBeUndefined();
expect(poDashboardComponent.find('DataTable').props().onOrderChange(0, 'asc', state.poData.poDataList.data));
expect(poDashboardComponent.find('.MuiTableSortLabel-icon').at(0).simulate('click'));
test('should render Alert components', () => {
at ReactWrapper.single (node_modules/enzyme/src/ReactWrapper.js:1168:13)
at ReactWrapper.simulate (node_modules/enzyme/src/ReactWrapper.js:665:17)
at Object.<anonymous> (tests/components/pages/PoDashboard/PoDashboard.test.js:118:75)
解决方案
推荐阅读
- memory - 访问使用内存位置声明的变量
- python - 如何在 Python 中的类中组合函数?
- java - Docker容器中的Kafka Streams应用程序奇怪的行为
- api - 在 SwaggerUI 中包含客户端 SDK 使用示例
- javascript - div容器内的Slick-Slider图像不调整基于窗口大小
- spring-boot - 如何使用 vue-cli 创建的 vuejs 将 Spring Boot 部署到 Heroku?
- python - 如果我使用自定义 dict 作为函数的全局变量,为什么我不能访问内置函数?
- go - Golang同时发送和接收udp数据包
- javascript - 使用 api 返回的 Html 进行重定向
- ruby-on-rails - 大规模更新时的 ActiveModel::Errors