javascript - 失败:无法读取未定义的属性“querySelector” - 业力茉莉
问题描述
我尝试使用业力和茉莉花来测试我的角度组件,在这里我收到错误“失败:无法读取未定义的属性'querySelector'”。
这是我的测试用例:这里我的目的是验证两个特定字段是否有输入的按钮。
beforeEach(() => {
fixture = TestBed.createComponent(SearchPanelComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
解决方案
推荐阅读
- python - 在查找包含数组值的 CSV 行时需要帮助
- c# - 管理实体中的静态数据项
- javascript - 提取 API 数据
- html - 移动 Safari 悬停/链接问题
- javascript - 仅接受 ()+ 和数字的正则表达式
- html - 滚动条拇指的高度
- python - 从 4D 数组中的相同索引获取值列表
- java - 如何重用通量单值?
- asp.net - system.applicationHost 和 system.WebServer 仅适用于 AppPool?
- python - 一个 POST API django-rest-framework。存储到模型后,调用 postgres 函数并发送电子邮件