Skip to content

Commit

Permalink
Added missing check on attribute name when adding data-cy attributes to
Browse files Browse the repository at this point in the history
submit elements.
  • Loading branch information
Dresse committed Nov 28, 2024
1 parent f064ce9 commit c2991c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/modules/custom/dpl_webform/dpl_webform.module
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ function dpl_webform_preprocess_input__submit(array &$variables): void {
]);
}

$variables['attributes']['data-cy'] = $variables['attributes']['name'];
// Add data-cy attributes to all input elements for cypress testing.
if (isset($variables['attributes']['name'])) {
$variables['attributes']['data-cy'] = $variables['attributes']['name'];
}
}

/**
Expand Down

0 comments on commit c2991c1

Please sign in to comment.