提交 6cd35fce 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(uts): 自动化测试 element.text 兼容 uni-button-element

上级 71b0a435
......@@ -99,7 +99,7 @@ export const getDOMProperties = (
if (dom != null) {
const properties = params.names.map((name: string): any | null => {
if (name == 'innerText') {
if (dom.tagName == 'TEXT') {
if (dom.tagName == 'TEXT' || dom.tagName == 'UNI-BUTTON-ELEMENT') {
return dom.getAttribute('value')
} else {
return getChildrenText(dom)
......
......@@ -304,7 +304,7 @@ export function componentSetData(
export function getChildrenText(node: INode): string {
let result = ''
node.childNodes.forEach((child) => {
if (child.tagName == 'TEXT') {
if (child.tagName == 'TEXT' || child.tagName == 'UNI-BUTTON-ELEMENT') {
result += child.getAttribute('value')
} else {
result += getChildrenText(child)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册