Add datalist test selectors

This commit is contained in:
Marliana Lara 2021-06-23 14:15:08 -04:00 committed by Shane McDonald
parent 1ba51c0357
commit 1e750cfed9
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -61,6 +61,7 @@ function DraggableSelectedList({ selected, onRemove, onRowDrag }) {
<>
<DataList
aria-label={t`Draggable list to reorder and remove selected items.`}
data-cy="draggable-list"
itemOrder={orderedList}
onDragCancel={onDragCancel}
onDragFinish={onDragFinish}
@ -81,13 +82,14 @@ function DraggableSelectedList({ selected, onRemove, onRowDrag }) {
Press enter to confirm the drag, or any other key to
cancel the drag operation.`}
aria-pressed="false"
data-cy={`reorder-${label}`}
/>
</DataListControl>
<DataListItemCells
dataListCells={[
<DataListCell key={label}>
<span id={rowPosition}>
{rowPosition}. {label}
{`${rowPosition}. ${label}`}
</span>
</DataListCell>,
]}
@ -97,7 +99,7 @@ function DraggableSelectedList({ selected, onRemove, onRowDrag }) {
onClick={() => removeItem(label)}
variant="plain"
aria-label={t`Remove`}
ouiaId="draggable-list-remove"
ouiaId={`draggable-list-remove-${label}`}
>
<TimesIcon />
</Button>