Skip to content

Add dataTestId across parameters inputs#1047

Open
Meklo wants to merge 1 commit intomainfrom
marcellinh/add_parameters_datatestid
Open

Add dataTestId across parameters inputs#1047
Meklo wants to merge 1 commit intomainfrom
marcellinh/add_parameters_datatestid

Conversation

@Meklo
Copy link
Copy Markdown
Contributor

@Meklo Meklo commented Mar 10, 2026

PR Summary

@sonarqubecloud
Copy link
Copy Markdown

<TableNumericalInput
{...props}
name={`${arrayFormName}[${rowIndex}].${column.dataKey}`}
data-testid={`DndNumericalInput-${rowIndex}`}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in this component are not harmless. They add datatest-id for many components using dnd-table. I'm not sure we want to do this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats right that this component is used in multipales places in params tabs but the goal here is to provide a reliable selector for testing without relying on fragile structural selectors.

<RawReadOnlyInput name={`${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}`} />
) : (
<FloatInput name={`${LIMIT_REDUCTIONS_FORM}[${rowIndex}].${column.dataKey}`} />
<FloatInput
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datatest-id is one solution to select an input. We should not forget all the other selection functionnalities of playwright
Here, why not selecting the row you want, and then the cell you want ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree that playwright provides other ways to select elements, however, when we have the opportunity to add a stable selector in a table component, its a useful addition and gives us another reliable option for selecting elements

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the approach you suggested (selecting the row ==> parsing it to find the cell) is conceptually doing the same thing we do here. the testid is already a combination of the row index and the column key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants