Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React testing library 如何检查元素是否隐藏在react测试库自定义查询中?_React Testing Library_Testing Library - Fatal编程技术网

React testing library 如何检查元素是否隐藏在react测试库自定义查询中?

React testing library 如何检查元素是否隐藏在react测试库自定义查询中?,react-testing-library,testing-library,React Testing Library,Testing Library,我想实现支持过滤隐藏元素的自定义查询,但是在测试库自定义查询中,如何确定元素是否隐藏 导出常量queryalByDataAttr=( 容器:HtmleElement, dataName:string, dataValue:string, 选项:{hidden:boolean}={hidden:false} ):HTMLElement[]=>{ 返回queryHelpers.queryAllByAttribute('data-'+数据名,容器,(content,el):布尔=>{ //如何确定元素

我想实现支持过滤隐藏元素的自定义查询,但是在
测试库
自定义查询中,如何确定元素是否隐藏

导出常量queryalByDataAttr=(
容器:HtmleElement,
dataName:string,
dataValue:string,
选项:{hidden:boolean}={hidden:false}
):HTMLElement[]=>{
返回queryHelpers.queryAllByAttribute('data-'+数据名,容器,(content,el):布尔=>{
//如何确定元素是否隐藏?
返回内容===数据值;
});
};
您所说的“隐藏元素”是什么意思?那是什么