mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-11 23:02:55 +01:00
feat(runtime): Add "data-testid" attributes to UI nodes (#42)
This commit is contained in:
@@ -20,6 +20,9 @@ const TextNode = {
|
||||
nodeDoubleClickAction: {
|
||||
focusPort: 'text'
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
},
|
||||
getReactComponent() {
|
||||
return Text;
|
||||
},
|
||||
@@ -135,6 +138,16 @@ const TextNode = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user