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):布尔=>{
//如何确定元素是否隐藏?
返回内容===数据值;
});
};
您所说的“隐藏元素”是什么意思?那是什么