feat(runtime): Add "data-testid" attributes to UI nodes (#42)

This commit is contained in:
Eric Tuvesson
2024-06-26 21:08:01 +02:00
committed by GitHub
parent 0ee55c26eb
commit fa282d6169
18 changed files with 129 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ const TextInputNode = {
return TextInput;
},
initialize() {
this.props.attrs = {};
this.props.startValue = '';
this.props.id = this._internal.controlId = 'input-' + guid();
},
@@ -167,6 +168,16 @@ const TextInputNode = {
break;
}
}
},
testId: {
index: 100009,
displayName: 'Test ID Attribute',
group: 'Advanced HTML',
type: 'string',
set(value) {
this.props.attrs["data-testid"] = value;
this.forceUpdate();
}
}
},
inputCss: {