Skip to content

Commit 95df574

Browse files
add selector for checkbox
1 parent e35a509 commit 95df574

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎packages/smart-forms-renderer/src/components/FormComponents/ItemParts/CheckboxSingle.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ function CheckboxSingle(props: CheckboxSingleProps) {
5353
const isHtmlDisabled = readOnlyWithDisabledStyle || disabledViaToggleExpression;
5454
const isHtmlReadOnly = readOnlyWithReadOnlyStyle && !disabledViaToggleExpression;
5555

56+
const textForDataTest = labelText ?? (typeof label === 'string' ? label : value);
57+
5658
return (
5759
<FormControlLabel
5860
sx={{
@@ -66,6 +68,7 @@ function CheckboxSingle(props: CheckboxSingleProps) {
6668
value={value}
6769
control={
6870
<StandardCheckbox
71+
data-test={`checkbox-single-${textForDataTest}`}
6972
size="small"
7073
checked={isChecked}
7174
readOnly={isHtmlReadOnly}

0 commit comments

Comments
 (0)