mirror of
https://github.com/fluxscape/fluxscape.git
synced 2026-01-12 23:32:55 +01:00
feat(runtime): Add "data-testid" attributes to UI nodes (#42)
This commit is contained in:
@@ -30,11 +30,24 @@ const ButtonNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.layout = 'row'; //Used to tell child nodes what layout to expect
|
||||
},
|
||||
getReactComponent() {
|
||||
return Button;
|
||||
},
|
||||
inputs: {
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputCss: {
|
||||
backgroundColor: {
|
||||
index: 100,
|
||||
|
||||
@@ -31,6 +31,7 @@ const CheckBoxNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'explicit';
|
||||
this.props.id = 'input-' + guid();
|
||||
this.props.checked = this._internal.checked = false;
|
||||
@@ -94,6 +95,16 @@ const CheckBoxNode = {
|
||||
this.flagOutputDirty('checked');
|
||||
this._updateVisualState();
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputCss: {
|
||||
|
||||
@@ -31,6 +31,7 @@ const OptionsNode = {
|
||||
]
|
||||
},
|
||||
initialize: function () {
|
||||
this.props.attrs = {};
|
||||
this._itemsChanged = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
@@ -90,6 +91,16 @@ const OptionsNode = {
|
||||
this.flagOutputDirty('value');
|
||||
}
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
|
||||
@@ -31,6 +31,7 @@ const RadioButtonNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'explicit';
|
||||
this.props.id = 'input-' + guid();
|
||||
|
||||
@@ -61,6 +62,16 @@ const RadioButtonNode = {
|
||||
set(value) {
|
||||
this.setStyle({ backgroundColor: value }, 'fill');
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
|
||||
@@ -27,6 +27,7 @@ const RangeNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'contentHeight';
|
||||
this.props.id = 'input-' + guid();
|
||||
|
||||
@@ -67,6 +68,16 @@ const RangeNode = {
|
||||
set(value) {
|
||||
this._setInputValue(value);
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
outputs: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user